For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Observability metrics

Query workload time-series metrics from Instance Prometheus with PromQL through platform-api.

Query time-series metrics for your workloads from Instance Prometheus. Use these endpoints to build runtime views for a Data Product, power dashboards, or let apps and AI agents read metric values with PromQL. The gateway forwards each request to the Instance Thanos query layer and returns a Prometheus-compatible response.

Method
Path
Use it to

GET

/v1/observability/metrics/query

Evaluate a PromQL expression at a single point in time

GET

/v1/observability/metrics/query_range

Evaluate a PromQL expression over a time range

GET

/v1/observability/metrics/labels

List label names

GET

/v1/observability/metrics/label/{name}/values

List values for one label

GET

/v1/observability/metrics/metadata

Get type, help text, and unit for metrics

All paths are relative to $BASE_URL (<DATAOS_FQDN>/platform-api). See Authentication.

Headers

All endpoints on this page accept the same headers.

Name
Value

Authorization or apikey

Bearer <access_token> or <your-apikey>. Required when gateway auth is enabled. See Authentication

Accept

application/json (recommended)

Dataos-Correlation-Id

Optional tracing ID

PromQL expressions contain characters such as {, }, ", and = that must be URL-encoded. The examples on this page use curl --get with --data-urlencode so curl encodes them for you.

Instant query

GET /v1/observability/metrics/query

Evaluates a PromQL expression at a single point in time and returns the latest sample for each matching series.

Query Parameters

Name
Type
Description

query

string

Required. PromQL expression, e.g. up{job="thanos-query"}

time

string

Evaluation time, as RFC3339 or Unix epoch seconds. Defaults to the current time

timeout

string

Query timeout

cURL:

Response

data.resultType is vector. Each entry in data.result has a metric object with the series labels and a value pair of [timestamp, "sample"]. data.analysis is also present (an object, empty in practice) and reserved for future use.

See Errors for the errorType values.

Range query

GET /v1/observability/metrics/query_range

Evaluates a PromQL expression at each step across a time range. Use it to plot a metric over time.

Query Parameters

Name
Type
Description

query

string

Required. PromQL expression

start

string

Required. Start of the range, as RFC3339 or Unix epoch seconds

end

string

Required. End of the range, as RFC3339 or Unix epoch seconds

step

string

Required. Resolution between samples, e.g. 60s

timeout

string

Query timeout

cURL:

Response

data.resultType is matrix. Each entry in data.result has a metric object with the series labels and a values list of [timestamp, "sample"] pairs, one per step. data.analysis is also present (an object, empty in practice) and reserved for future use.

See Errors for the errorType values. Exceeding the 11,000-point resolution cap returns the same bad_data shape, with "error": "exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)".

Label names

GET /v1/observability/metrics/labels

Lists the label names available on stored series. Use it to discover which labels you can filter on in a PromQL expression.

Query Parameters

Name
Type
Description

start

string

Start of the time range to search

end

string

End of the time range to search

match[]

string

Series selector that limits which series are searched, e.g. up

cURL:

Response

data is an array of label names.

Label values

GET /v1/observability/metrics/label/{name}/values

Lists the values recorded for one label. Use __name__ to list metric names.

Path Parameters

Name
Type
Description

name

string

Label name, e.g. job, namespace, or __name__

cURL:

Response

data is an array of values for the requested label.

Metric metadata

GET /v1/observability/metrics/metadata

Returns the type, help text, and unit for metrics. Use it to understand what a metric measures before you query it.

Query Parameters

Name
Type
Description

metric

string

Return metadata for one metric name only

limit

number

Maximum number of metric names to return

cURL:

Response

data is a map keyed by metric name. Each entry lists the metric type, help text, and unit.

Errors

Query errors use the Prometheus error format: status is error, and errorType tells you what went wrong.

errorType

Meaning

bad_data

The query or a parameter is invalid

timeout

The query timed out

execution

The query failed during evaluation

Notes

  • Sample values are returned as strings (for example "1"). Convert them to numbers in your client.

  • Timestamps in value and values are Unix epoch seconds and may include a fractional part.

  • Instant queries return a vector (one sample per series). Range queries return a matrix (a list of samples per series).

  • Start with Label names and Label values to find the labels and metric names to use in your PromQL expressions.

Last updated

Was this helpful?