POST /accounts/{account_id}/workers/observability/telemetry/query

Run a temporary or saved query.

Servers

Path parameters

Name Type Required Description
account_id String Yes

Your Cloudflare account ID.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
dry Boolean No

Whether to perform a dry run without saving the results of the query. Useful for validation

Default value: false

ignoreSeries Boolean No

Whether to ignore time-series data in the results and return only aggregated values

Default value: false

timeframe Object Yes

Timeframe for your query using Unix timestamps in milliseconds. Provide from/to epoch ms; narrower timeframes provide faster responses and more specific results.

timeframe.to Number Yes

End timestamp for the query timeframe (Unix timestamp in milliseconds)

timeframe.from Number Yes

Start timestamp for the query timeframe (Unix timestamp in milliseconds)

parameters Object No

Optional parameters to pass to the query execution

parameters.datasets[] Array No

Set the Datasets to query. Leave it empty to query all the datasets.

parameters.filters[] Array No

Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. Maximum nesting depth is 4.

parameters.limit Integer No

Set a limit on the number of results / records returned by the query

parameters.filterCombination String No

Set a Flag to describe how to combine the filters on the query.

Valid values:

  • "AND"
  • "and"
  • "or"
  • "OR"
parameters.orderBy Object No

Configure the order of the results returned by the query.

parameters.orderBy.order String No

Set the order of the results

Valid values:

  • "desc"
  • "asc"
parameters.orderBy.value String Yes

Configure which Calculation to order the results by.

parameters.needle Object No

Define an expression to search using full-text search.

parameters.needle.value String Yes
parameters.needle.matchCase Boolean No
parameters.needle.isRegex Boolean No
parameters.groupBys[] Array No

Define how to group the results of the query.

parameters.groupBys[].type String Yes

Valid values:

  • "string"
  • "boolean"
  • "number"
parameters.groupBys[].value String Yes
parameters.havings[] Array No

Configure the Having clauses that filter on calculations in the query result.

parameters.havings[].key String Yes
parameters.havings[].operation String Yes

Valid values:

  • "gt"
  • "gte"
  • "eq"
  • "lte"
  • "neq"
  • "lt"
parameters.havings[].value Number Yes
parameters.calculations[] Array No

Create Calculations to compute as part of the query.

parameters.calculations[].operator String Yes

Valid values:

  • "count"
  • "MAX"
  • "p10"
  • "COUNT_DISTINCT"
  • "P05"
  • "sum"
  • "median"
  • "p90"
  • "P99"
  • "MIN"
  • "P999"
  • "P75"
  • "P25"
  • "P01"
  • "stddev"
  • "p001"
  • "COUNT"
  • "P95"
  • "VARIANCE"
  • "min"
  • "p01"
  • "p25"
  • "p75"
  • "p99"
  • "p95"
  • "STDDEV"
  • "AVG"
  • "MEDIAN"
  • "P10"
  • "max"
  • "variance"
  • "uniq"
  • "P90"
  • "p05"
  • "P001"
  • "avg"
  • "p999"
  • "SUM"
parameters.calculations[].key String No

The key to use for the calculation. This key must exist in the logs. Use the observability_keys response to confirm. Do not guess keys.

parameters.calculations[].keyType String No

Valid values:

  • "string"
  • "boolean"
  • "number"
parameters.calculations[].alias String No
view String No

Examples by view type. Events: show errors for a worker in the last 30 minutes. Calculations: p99 of wall time or count by status code. Invocations: find a specific request that resulted in a 500.

Valid values:

  • "requests"
  • "calculations"
  • "agents"
  • "traces"
  • "events"
  • "invocations"

Default value: "calculations"

offsetBy Number No

Numeric offset for pattern results (top-N list). Use with limit to page pattern groups; not used by cursor pagination.

chart Boolean No

Whether to include timeseties data in the response

limit Number No

Use this limit to cap the number of events returned when the view is events.

Default value: 50

queryId String Yes

Unique identifier for the query to execute

offsetDirection String No

Direction for offset-based pagination (e.g., 'next', 'prev')

granularity Number No

This is only used when the view is calculations. Leaving it empty lets Workers Observability detect the correct granularity.

compare Boolean No

Whether to include comparison data with previous time periods

offset String No

Cursor pagination for event/trace/invocation views. Pass the last item's $metadata.id as the next offset.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.