Hanzo
OpenapiO11y

Evaluates one instant PromQL query against the org's metrics and returns the…

Evaluates one instant PromQL query against the org's metrics and returns the result at a single point in time.

GET /v1/o11y/query

Addresshttps://api.hanzo.ai/v1/o11y/query
MethodGET
Operationget_o11y_query
AuthAuthorization: Bearer $HANZO_API_KEY

Evaluates one instant PromQL query against the org's metrics and returns the result at a single point in time.

The result is polymorphic by PromQL's own contract — a matrix, vector, scalar or string, discriminated by resultType — so it is carried verbatim rather than forced into one of its shapes.

Callers need the viewer role; the runtime's own gate enforces it.

Request

4 fields.

FieldInTypeRequiredDescription
queryquerystringyesQuery is the PromQL expression to evaluate.
timequerystringTime is the evaluation timestamp — epoch seconds or RFC3339.
statsquerystringStats set to any non-empty value includes query statistics in the answer.
timeoutquerystringTimeout caps evaluation time, as a duration in seconds.

Response

StatusBodyMeaning
200o11y.O11yPromQueryOutok

200 body — 5 fields.

FieldInTypeAlwaysDescription
databodyo11y.O11yPromResult
data.resultbodyanyResult is the result in PromQL's own wire shape for ResultType, carried verbatim.
data.resultTypebodystringResultType discriminates Result: matrix, vector, scalar or string.
data.statsbodyanyStats holds query statistics when the caller asked for them.
statusbodystringStatus is "success".

Failure carries the platform error shape — see Errors.

Examples

hanzo o11y query --query <query>

O11y API · All Hanzo APIs · Interactive reference

How is this guide?

On this page