Menu
Grafana Cloud
Metrics REST API
Use these endpoints to access metrics metadata from test runs.
List metrics
GET /test_runs/:testRunId/metrics
Example request:
http
GET https://api.k6.io/cloud/v5/test_runs/152779/metrics
Accept: application/json
Authorization: Token 56c166885f9a7fc1e588a1b3cb66f6dd
Example response
http
HTTP/1.1 200
Content-Type: application/json
{
"value": [
{
"id": "1af77c11-5b93-58ba-b7a2-c839b0402cf7",
"name": "load_generator_file_handles",
"origin": "builtin",
"test_run_id": 152779,
"type": "gauge"
},
{
"id": "38ae6276-4630-5ad6-a3bb-d11f678d96dd",
"name": "iteration_duration",
"origin": "builtin",
"test_run_id": 152779,
"type": "trend"
},
{
"id": "4643ca9f-9539-5e86-9937-2ae956f9dcc4",
"name": "data_sent",
"origin": "builtin",
"test_run_id": 152779,
"type": "counter"
},
{
"id": "5d0b30bf-321c-5c2d-a318-ebfb7d79c915",
"name": "vus",
"origin": "builtin",
"test_run_id": 152779,
"type": "gauge"
}
]
}
List time series
Note: This API output is similar to Prometheus series API
GET /test_runs/:testRunId/series
Parameter | Description |
---|---|
match[] | Repeated series selector argument that selects the series to return. At least one match[] argument must be provided. |
Example request:
http
GET https://api.k6.io/cloud/v5/test_runs/152777/series?match[]=http_req_duration{expected_response="true"}
Accept: application/json
Authorization: Token 56c166885f9a7fc1e588a1b3cb66f6dd
Example response
http
HTTP/1.1 200
Content-Type: application/json
{
"status": "success",
"data": [
{
"__name__": "http_req_duration",
"expected_response": "true",
"group": "::g2",
"instance_id": "0",
"load_zone": "amazon:us:columbus",
"method": "GET",
"name": "http://test.k6.io/",
"proto": "HTTP/1.1",
"scenario": "http_with_groups",
"status": "200",
"test_run_id": "152777",
"url": "http://test.k6.io/"
},
{
"__name__": "http_req_duration",
"expected_response": "true",
"group": "",
"instance_id": "4",
"load_zone": "amazon:us:columbus",
"method": "GET",
"name": "http://test.k6.io/?q=3",
"proto": "HTTP/1.1",
"scenario": "http_simple",
"status": "200",
"test_run_id": "152777",
"url": "http://test.k6.io/?q=3"
}
]
}
Query label names
Note: This API output is similar to Prometheus labels API
GET /test_runs/:testRunId/labels
Parameter | Description |
---|---|
match[] | Optional: repeated series selector argument that selects the series from which to read the label names. |
Example request:
http
GET https://api.k6.io/cloud/v5/test_runs/152777/labels?match[]=http_req_duration
Accept: application/json
Authorization: Token 56c166885f9a7fc1e588a1b3cb66f6dd
Example response
http
HTTP/1.1 200
Content-Type: application/json
{
"status": "success"
"data": [
"__name__",
"expected_response",
"group",
"instance_id",
"load_zone",
"method",
"name",
"proto",
"scenario",
"status",
"test_run_id",
"url"
],
}
Query label values
Note: This API output is similar to Prometheus label values API
GET /test_runs/:testRunId/label/:labelName/values
Parameter | Description |
---|---|
match[] | Optional: repeated series selector argument that selects the series from which to read the label values. |
Example request:
http
GET https://api.k6.io/cloud/v5/test_runs/152777/label/load_zone/values?match[]=http_req_duration
Accept: application/json
Authorization: Token 56c166885f9a7fc1e588a1b3cb66f6dd
Example response
http
HTTP/1.1 200
Content-Type: application/json
{
"status": "success"
"data": [
"amazon:us:columbus",
"amazon:eu:dublin",
],
}
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:

Getting started with your metrics, logs, and traces in Grafana Cloud
Learn to use the best open source observability software (Grafana, Prometheus, Loki, and Tempo) without the overhead of managing and scaling your own stack.

Kubernetes monitoring, out-of-the-box with Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.

Unify your data with Grafana plugins: Datadog, Splunk, MongoDB, and more
In this webinar, learn how to leverage Grafana's plugin ecosystem for access to 80+ data sources, including plugins for Datadog, Splunk, MongoDB, and more.