Hanzo
OpenapiO11y

Analyzes a query and extracts the metric names it reads and the columns it…

Analyzes a query and extracts the metric names it reads and the columns it groups by.

POST /v1/o11y/query_filter/analyze

Addresshttps://api.hanzo.ai/v1/o11y/query_filter/analyze
MethodPOST
Operationpost_o11y_query_filter_analyze
AuthAuthorization: Bearer $HANZO_API_KEY

Analyzes a query and extracts the metric names it reads and the columns it groups by.

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

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
querybodystringyesQuery is the query text.
queryTypebodystringyesQueryType says which language the query is in — promql or the datastore's SQL dialect.

Response

StatusBodyMeaning
200o11y.O11yAnalyzeOutok

200 body — 6 fields.

FieldInTypeAlwaysDescription
databodyo11y.O11yQueryFilterAnalysis
data.groupsbodyo11y.O11yColumnInfo[]Groups are the columns the query groups by.
data.groups[].columnAliasbodystringAlias is the column's alias in the query, when it has one.
data.groups[].columnNamebodystringName is the column's name.
data.metricNamesbodystring[]MetricNames are the metrics the query reads.
statusbodystringStatus is "success".

Failure carries the platform error shape — see Errors.

Examples

hanzo o11y query_filter analyze \
  --query <query> \
  --query-type <queryType>

O11y API · All Hanzo APIs · Interactive reference

How is this guide?

On this page