> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/references/october2026/interfaces/apis/core-apis/api-reference/observability-metrics.md).

# 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](https://v2.dataos.info/references/october2026/interfaces/apis/core-apis/authentication.md).

### Headers

All endpoints on this page accept the same headers.

<table><thead><tr><th width="225.6763916015625">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>Authorization</code> or <code>apikey</code></td><td><code>Bearer &#x3C;access_token></code> or <code>&#x3C;your-apikey></code>. Required when gateway auth is enabled. See <a href="https://v2.dataos.info/references/october2026/interfaces/apis/core-apis/authentication.md">Authentication</a></td></tr><tr><td><code>Accept</code></td><td><code>application/json</code> (recommended)</td></tr><tr><td><code>Dataos-Correlation-Id</code></td><td>Optional tracing ID</td></tr></tbody></table>

{% hint style="info" %}
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.
{% endhint %}

## 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

<table><thead><tr><th width="168.124267578125">Name</th><th width="113.1383056640625">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code></td><td>string</td><td>Required. PromQL expression, e.g. <code>up{job="thanos-query"}</code></td></tr><tr><td><code>time</code></td><td>string</td><td>Evaluation time, as RFC3339 or Unix epoch seconds. Defaults to the current time</td></tr><tr><td><code>timeout</code></td><td>string</td><td>Query timeout</td></tr></tbody></table>

**cURL:**

{% code title="Instant query" expandable="true" collapsedlinecount="5" %}

```bash
curl --get "https://$BASE_URL/v1/observability/metrics/query" \
  -H "Accept: application/json" \
  -H "apikey: <your-apikey>" \
  --data-urlencode 'query=up{job="thanos-query"}'
```

{% endcode %}

### Response

{% tabs %}
{% tab title="200" %}
{% code expandable="true" collapsedlinecount="5" %}

```json
{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {
          "__name__": "up",
          "job": "thanos-query",
          "namespace": "sawaniks-0-core",
          "pod": "thanos-query-0",
          "service": "thanos-query"
        },
        "value": [1787663053.999, "1"]
      }
    ]
  }
}
```

{% endcode %}

`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.
{% endtab %}

{% tab title="Error" %}
{% code expandable="true" collapsedlinecount="5" %}

```json
{
  "status": "error",
  "errorType": "bad_data",
  "error": "parse error: no expression found in input"
}
```

{% endcode %}

See [Errors](#errors) for the `errorType` values.
{% endtab %}
{% endtabs %}

## 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

<table><thead><tr><th width="168.124267578125">Name</th><th width="113.1383056640625">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code></td><td>string</td><td>Required. PromQL expression</td></tr><tr><td><code>start</code></td><td>string</td><td>Required. Start of the range, as RFC3339 or Unix epoch seconds</td></tr><tr><td><code>end</code></td><td>string</td><td>Required. End of the range, as RFC3339 or Unix epoch seconds</td></tr><tr><td><code>step</code></td><td>string</td><td>Required. Resolution between samples, e.g. <code>60s</code></td></tr><tr><td><code>timeout</code></td><td>string</td><td>Query timeout</td></tr></tbody></table>

{% hint style="warning" %}
The number of samples per series, `(end - start) / step`, is capped at 11,000. A large range with a small `step` (for example, a 1-year range at `step=1s`) returns a `400 bad_data` error asking you to increase `step`. Widen `step` or narrow the range to stay under the cap.
{% endhint %}

**cURL:**

{% code title="Range query (5 minutes, 60-second steps)" expandable="true" collapsedlinecount="5" %}

```bash
curl --get "https://$BASE_URL/v1/observability/metrics/query_range" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>" \
  --data-urlencode 'query=up{job="thanos-query"}' \
  --data-urlencode 'start=1787662742' \
  --data-urlencode 'end=1787663042' \
  --data-urlencode 'step=60s'
```

{% endcode %}

### Response

{% tabs %}
{% tab title="200" %}
{% code expandable="true" collapsedlinecount="5" %}

```json
{
  "status": "success",
  "data": {
    "resultType": "matrix",
    "result": [
      {
        "metric": {
          "__name__": "up",
          "job": "thanos-query",
          "namespace": "sawaniks-0-core",
          "pod": "thanos-query-0"
        },
        "values": [
          [1787662862, "1"],
          [1787662922, "1"],
          [1787662982, "1"]
        ]
      }
    ]
  }
}
```

{% endcode %}

`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.
{% endtab %}

{% tab title="Error" %}
{% code expandable="true" collapsedlinecount="5" %}

```json
{
  "status": "error",
  "errorType": "bad_data",
  "error": "parse error: no expression found in input"
}
```

{% endcode %}

See [Errors](#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)"`.
{% endtab %}
{% endtabs %}

## 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

<table><thead><tr><th width="168.124267578125">Name</th><th width="113.1383056640625">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>start</code></td><td>string</td><td>Start of the time range to search</td></tr><tr><td><code>end</code></td><td>string</td><td>End of the time range to search</td></tr><tr><td><code>match[]</code></td><td>string</td><td>Series selector that limits which series are searched, e.g. <code>up</code></td></tr></tbody></table>

**cURL:**

{% code title="List label names" expandable="true" collapsedlinecount="5" %}

```bash
curl -X GET \
  "https://$BASE_URL/v1/observability/metrics/labels" \
  -H "Accept: application/json" \
  -H "apikey: <your-apikey>"
```

{% endcode %}

### Response

{% tabs %}
{% tab title="200" %}
{% code expandable="true" collapsedlinecount="5" %}

```json
{
  "status": "success",
  "data": [
    "__name__",
    "job",
    "namespace",
    "pod",
    "service"
  ]
}
```

{% endcode %}

`data` is an array of label names.
{% endtab %}
{% endtabs %}

## Label values

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

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

### Path Parameters

<table><thead><tr><th width="137.524169921875">Name</th><th width="136.20068359375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>string</td><td>Label name, e.g. <code>job</code>, <code>namespace</code>, or <code>__name__</code></td></tr></tbody></table>

**cURL:**

{% code title="List values for the job label" expandable="true" collapsedlinecount="5" %}

```bash
curl -X GET \
  "https://$BASE_URL/v1/observability/metrics/label/job/values" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>"
```

{% endcode %}

### Response

{% tabs %}
{% tab title="200" %}
{% code expandable="true" collapsedlinecount="5" %}

```json
{
  "status": "success",
  "data": [
    "apiserver",
    "cert-manager",
    "thanos-query"
  ]
}
```

{% endcode %}

`data` is an array of values for the requested label.
{% endtab %}
{% endtabs %}

## 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

<table><thead><tr><th width="168.124267578125">Name</th><th width="113.1383056640625">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>metric</code></td><td>string</td><td>Return metadata for one metric name only</td></tr><tr><td><code>limit</code></td><td>number</td><td>Maximum number of metric names to return</td></tr></tbody></table>

**cURL:**

{% code title="Metadata for two metrics" expandable="true" collapsedlinecount="5" %}

```bash
curl -X GET \
  "https://$BASE_URL/v1/observability/metrics/metadata?limit=2" \
  -H "Accept: application/json" \
  -H "apikey: <your-apikey>"
```

{% endcode %}

### Response

{% tabs %}
{% tab title="200" %}
{% code expandable="true" collapsedlinecount="5" %}

```json
{
  "status": "success",
  "data": {
    "up": [
      {
        "type": "gauge",
        "help": "Target scrape health (1 = up, 0 = down)",
        "unit": ""
      }
    ]
  }
}
```

{% endcode %}

`data` is a map keyed by metric name. Each entry lists the metric `type`, `help` text, and `unit`.
{% endtab %}
{% endtabs %}

## Errors

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

```json
{
  "status": "error",
  "errorType": "bad_data",
  "error": "parse error: no expression found in input"
}
```

| `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](#label-names) and [Label values](#label-values) to find the labels and metric names to use in your PromQL expressions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v2.dataos.info/references/october2026/interfaces/apis/core-apis/api-reference/observability-metrics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
