Query server for exposed Prometheus metrics
curl --request GET \
--url http://localhost:8080/metricsimport requests
url = "http://localhost:8080/metrics"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:8080/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/metrics"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/metrics")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/metrics")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.\n# TYPE go_gc_duration_seconds summary\ngo_gc_duration_seconds{quantile=\"0\"} 2.9153e-05\ngo_gc_duration_seconds{quantile=\"0.25\"} 6.2832e-05\ngo_gc_duration_seconds{quantile=\"0.5\"} 9.7187e-05\ngo_gc_duration_seconds{quantile=\"0.75\"} 0.000112967\ngo_gc_duration_seconds{quantile=\"1\"} 0.000215819\ngo_gc_duration_seconds_sum 0.001376862\ngo_gc_duration_seconds_count 14\n"API Reference
Query server for exposed Prometheus metrics
See Prometheus documentation for a complete data model.
GET
/
metrics
Query server for exposed Prometheus metrics
curl --request GET \
--url http://localhost:8080/metricsimport requests
url = "http://localhost:8080/metrics"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:8080/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/metrics"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/metrics")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/metrics")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.\n# TYPE go_gc_duration_seconds summary\ngo_gc_duration_seconds{quantile=\"0\"} 2.9153e-05\ngo_gc_duration_seconds{quantile=\"0.25\"} 6.2832e-05\ngo_gc_duration_seconds{quantile=\"0.5\"} 9.7187e-05\ngo_gc_duration_seconds{quantile=\"0.75\"} 0.000112967\ngo_gc_duration_seconds{quantile=\"1\"} 0.000215819\ngo_gc_duration_seconds_sum 0.001376862\ngo_gc_duration_seconds_count 14\n"Response
200 - text/plain
Successfully returned Prometheus metrics
The response is of type string.
Example:
"# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.\n# TYPE go_gc_duration_seconds summary\ngo_gc_duration_seconds{quantile=\"0\"} 2.9153e-05\ngo_gc_duration_seconds{quantile=\"0.25\"} 6.2832e-05\ngo_gc_duration_seconds{quantile=\"0.5\"} 9.7187e-05\ngo_gc_duration_seconds{quantile=\"0.75\"} 0.000112967\ngo_gc_duration_seconds{quantile=\"1\"} 0.000215819\ngo_gc_duration_seconds_sum 0.001376862\ngo_gc_duration_seconds_count 14\n"
Related topics
1Password Connect Server API referenceUse the 1Password MCP Server to manage your 1Password EnvironmentsSecure secrets for AI agents and toolsWas this page helpful?
⌘I