Query server for exposed Prometheus metrics
GET
/metrics
const url = 'http://localhost:8080/metrics';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/metricsSee Prometheus documentation for a complete data model.
Responses
Section titled “ Responses ”Successfully returned Prometheus metrics
string
Example
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.# TYPE go_gc_duration_seconds summarygo_gc_duration_seconds{quantile="0"} 2.9153e-05go_gc_duration_seconds{quantile="0.25"} 6.2832e-05go_gc_duration_seconds{quantile="0.5"} 9.7187e-05go_gc_duration_seconds{quantile="0.75"} 0.000112967go_gc_duration_seconds{quantile="1"} 0.000215819go_gc_duration_seconds_sum 0.001376862go_gc_duration_seconds_count 14