Skip to content

observe_metrics_query

Read one metric of the current product as a time series.

Tool

observe_metrics_query

Read one metric of the current product as a time series.

Read one metric of the current product as a time series. Cumulative counters are differenced at read time, so a process restart reads as its own increase rather than as a negative spike; histogram percentiles are interpolated across the emitter's buckets. Up to 100 series and 500 points each, over at most 31 days; truncated says when a ceiling was reached.

Behavior

HTTP
GET /observe/metrics/query

Arguments

NameTypeRequiredDescription
tostringEnd of the window, ISO 8601; default now
fromstringStart of the window, ISO 8601; default one hour ago
namestringThe metric to read, exactly as observe_metrics_list names it
stepstringBucket width; default the finest that renders at most 500 points
groupByarrayAttribute keys to keep as the series labels, aggregating every other attribute into them; default one series per distinct attribute set
servicestringOnly points from this service
attributesobjectOnly points whose attributes match every one of these key/value pairs
aggregationstringHow to aggregate each step. A counter takes "rate" (per second), "increase" (over the step) or "value" (its last reading); a histogram takes "p50", "p90", "p99", "avg" or "count". A pair that does not match the metric is rejected.
environmentstringOnly points from this environment

Response

FieldTypeAlwaysDescription
tostringEnd of the window that was read, ISO 8601
fromstringStart of the window that was read, ISO 8601
namestringThe metric that was read
stepstringThe bucket width the series is rendered at
typestringWhat the metric holds: a counter ("sum") or an explicit-bucket histogram
unitstringUnit as the emitter declared it; empty when none
seriesarrayOne series per label set, ordered stably
truncatedbooleanTrue when a ceiling cut the answer — more series exist than were returned
aggregationstringThe aggregation that was applied
stepSecondsnumberThat width in seconds — what a rate was divided by

Try it

Read one metric of the current product as a time series.

When to use

Read one metric of the current product as a time series. Cumulative counters are differenced at read time, so a process restart reads as its own increase rather than as a negative spike; histogram percentiles are interpolated across the emitter's buckets. Up to 100 series and 500 points each, over at most 31 days; truncated says when a ceiling was reached.

Example

Ask your agent something like this:

Read one metric of the current product as a time series.

The agent will invoke observe_metrics_query with these arguments:

{
  "name": "<name>",
  "aggregation": "<aggregation>"
}

Esc

Start typing to search the docs.

navigateselect