Skip to content
Start here

Run a query

workers.observability.telemetry.query(TelemetryQueryParams**kwargs) -> TelemetryQueryResponse
POST/accounts/{account_id}/workers/observability/telemetry/query

Run a temporary or saved query.

Security
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
User Service Key

Used when interacting with the Origin CA certificates API. View/change your key.

Example:X-Auth-User-Service-Key: v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719
Accepted Permissions (at least one required)
Workers Observability Write
ParametersExpand Collapse
account_id: str
query_id: str

Unique identifier for the query to execute

timeframe: Timeframe

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

from_: float

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

to: float

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

chart: Optional[bool]

Whether to include timeseties data in the response

compare: Optional[bool]

Whether to include comparison data with previous time periods

dry: Optional[bool]

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

granularity: Optional[float]

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

ignore_series: Optional[bool]

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

limit: Optional[float]

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

maximum2000
offset: Optional[str]

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

offset_by: Optional[float]

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

offset_direction: Optional[str]

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

parameters: Optional[Parameters]

Optional parameters to pass to the query execution

calculations: Optional[Iterable[ParametersCalculation]]

Create Calculations to compute as part of the query.

operator: Literal["uniq", "count", "max", 35 more]
One of the following:
"uniq"
"count"
"max"
"min"
"sum"
"avg"
"median"
"p001"
"p01"
"p05"
"p10"
"p25"
"p75"
"p90"
"p95"
"p99"
"p999"
"stddev"
"variance"
"COUNT_DISTINCT"
"COUNT"
"MAX"
"MIN"
"SUM"
"AVG"
"MEDIAN"
"P001"
"P01"
"P05"
"P10"
"P25"
"P75"
"P90"
"P95"
"P99"
"P999"
"STDDEV"
"VARIANCE"
alias: Optional[str]
key: Optional[str]

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.

key_type: Optional[Literal["string", "number", "boolean"]]
One of the following:
"string"
"number"
"boolean"
datasets: Optional[SequenceNotStr[str]]

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

filter_combination: Optional[Literal["and", "or", "AND", "OR"]]

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

One of the following:
"and"
"or"
"AND"
"OR"
filters: Optional[Iterable[ParametersFilter]]

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

One of the following:
class ParametersFilterUnionMember0:
filter_combination: Literal["and", "or", "AND", "OR"]
One of the following:
"and"
"or"
"AND"
"OR"
filters: Iterable[object]
kind: Literal["group"]
class ParametersFilterWorkersObservabilityFilterLeaf:

Filtering best practices: use observability_keys and observability_values to confirm available fields and values. If searching for errors, filter for $metadata.error exists.

key: str

Filter field name. IMPORTANT: do not guess keys. Always use verified keys from previous query results or the observability_keys response. Preferred keys: $metadata.service, $metadata.origin, $metadata.trigger, $metadata.message, $metadata.error.

operation: Literal["includes", "not_includes", "starts_with", 25 more]
One of the following:
"includes"
"not_includes"
"starts_with"
"regex"
"exists"
"is_null"
"in"
"not_in"
"eq"
"neq"
"gt"
"gte"
"lt"
"lte"
"="
"!="
">"
">="
"<"
"<="
"INCLUDES"
"DOES_NOT_INCLUDE"
"MATCH_REGEX"
"EXISTS"
"DOES_NOT_EXIST"
"IN"
"NOT_IN"
"STARTS_WITH"
type: Literal["string", "number", "boolean"]
One of the following:
"string"
"number"
"boolean"
kind: Optional[Literal["filter"]]
value: Optional[Union[str, float, bool]]

Filter comparison value. IMPORTANT: must match actual values in your logs. Verify using previous query results or the /values endpoint. Ensure value type matches the field type. String comparisons are case-sensitive unless using specific operations. Regex uses ClickHouse RE2 syntax (no lookaheads/lookbehinds); examples: ^5\d{2}$ for HTTP 5xx, \bERROR\b for word boundary.

One of the following:
str
float
bool
group_bys: Optional[Iterable[ParametersGroupBy]]

Define how to group the results of the query.

type: Literal["string", "number", "boolean"]
One of the following:
"string"
"number"
"boolean"
value: str
havings: Optional[Iterable[ParametersHaving]]

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

key: str
operation: Literal["eq", "neq", "gt", 3 more]
One of the following:
"eq"
"neq"
"gt"
"gte"
"lt"
"lte"
value: float
limit: Optional[int]

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

maximum2000
minimum0
needle: Optional[ParametersNeedle]

Define an expression to search using full-text search.

value: Union[str, float, bool]
maxLength1000
One of the following:
str
float
bool
is_regex: Optional[bool]
match_case: Optional[bool]
order_by: Optional[ParametersOrderBy]

Configure the order of the results returned by the query.

value: str

Configure which Calculation to order the results by.

order: Optional[Literal["asc", "desc"]]

Set the order of the results

One of the following:
"asc"
"desc"
view: Optional[Literal["traces", "events", "calculations", 3 more]]

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.

One of the following:
"traces"
"events"
"calculations"
"invocations"
"requests"
"agents"
ReturnsExpand Collapse
class TelemetryQueryResponse:
run: Run

A Workers Observability Query Object

id: str
account_id: str
dry: bool
granularity: float
query: RunQuery
id: str
adhoc: bool

If the query wasn’t explcitly saved

created: str
created_by: str
description: Optional[str]
maxLength1000
name: str

Query name

maxLength250
minLength1
parameters: RunQueryParameters
calculations: Optional[List[RunQueryParametersCalculation]]

Create Calculations to compute as part of the query.

operator: Literal["uniq", "count", "max", 35 more]
One of the following:
"uniq"
"count"
"max"
"min"
"sum"
"avg"
"median"
"p001"
"p01"
"p05"
"p10"
"p25"
"p75"
"p90"
"p95"
"p99"
"p999"
"stddev"
"variance"
"COUNT_DISTINCT"
"COUNT"
"MAX"
"MIN"
"SUM"
"AVG"
"MEDIAN"
"P001"
"P01"
"P05"
"P10"
"P25"
"P75"
"P90"
"P95"
"P99"
"P999"
"STDDEV"
"VARIANCE"
alias: Optional[str]
key: Optional[str]
key_type: Optional[Literal["string", "number", "boolean"]]
One of the following:
"string"
"number"
"boolean"
datasets: Optional[List[str]]

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

filter_combination: Optional[Literal["and", "or", "AND", "OR"]]

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

One of the following:
"and"
"or"
"AND"
"OR"
filters: Optional[List[RunQueryParametersFilter]]

Configure the Filters to apply to the query. Supports nested groups via kind: ‘group’.

One of the following:
class RunQueryParametersFilterUnionMember0:
filter_combination: Literal["and", "or", "AND", "OR"]
One of the following:
"and"
"or"
"AND"
"OR"
filters: List[object]
kind: Literal["group"]
class RunQueryParametersFilterWorkersObservabilityFilterLeaf:

Filtering best practices: use observability_keys and observability_values to confirm available fields and values. If searching for errors, filter for $metadata.error exists.

key: str

Filter field name. IMPORTANT: do not guess keys. Always use verified keys from previous query results or the observability_keys response. Preferred keys: $metadata.service, $metadata.origin, $metadata.trigger, $metadata.message, $metadata.error.

operation: Literal["includes", "not_includes", "starts_with", 25 more]
One of the following:
"includes"
"not_includes"
"starts_with"
"regex"
"exists"
"is_null"
"in"
"not_in"
"eq"
"neq"
"gt"
"gte"
"lt"
"lte"
"="
"!="
">"
">="
"<"
"<="
"INCLUDES"
"DOES_NOT_INCLUDE"
"MATCH_REGEX"
"EXISTS"
"DOES_NOT_EXIST"
"IN"
"NOT_IN"
"STARTS_WITH"
type: Literal["string", "number", "boolean"]
One of the following:
"string"
"number"
"boolean"
kind: Optional[Literal["filter"]]
value: Optional[Union[str, float, bool, null]]

Filter comparison value. IMPORTANT: must match actual values in your logs. Verify using previous query results or the /values endpoint. Ensure value type matches the field type. String comparisons are case-sensitive unless using specific operations. Regex uses ClickHouse RE2 syntax (no lookaheads/lookbehinds); examples: ^5\d{2}$ for HTTP 5xx, \bERROR\b for word boundary.

One of the following:
str
float
bool
group_bys: Optional[List[RunQueryParametersGroupBy]]

Define how to group the results of the query.

type: Literal["string", "number", "boolean"]
One of the following:
"string"
"number"
"boolean"
value: str
havings: Optional[List[RunQueryParametersHaving]]

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

key: str
operation: Literal["eq", "neq", "gt", 3 more]
One of the following:
"eq"
"neq"
"gt"
"gte"
"lt"
"lte"
value: float
limit: Optional[int]

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

maximum100
minimum0
needle: Optional[RunQueryParametersNeedle]

Define an expression to search using full-text search.

value: RunQueryParametersNeedleValue
is_regex: Optional[bool]
match_case: Optional[bool]
order_by: Optional[RunQueryParametersOrderBy]

Configure the order of the results returned by the query.

value: str

Configure which Calculation to order the results by.

order: Optional[Literal["asc", "desc"]]

Set the order of the results

One of the following:
"asc"
"desc"
updated: str
updated_by: str
status: Literal["STARTED", "COMPLETED"]
One of the following:
"STARTED"
"COMPLETED"
timeframe: RunTimeframe

Time range for the query execution

from_: float

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

to: float

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

user_id: str
created: Optional[str]
statistics: Optional[RunStatistics]
bytes_read: float

Number of uncompressed bytes read from the table.

elapsed: float

Time in seconds for the query to run.

rows_read: float

Number of rows scanned from the table.

abr_level: Optional[float]

The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1

updated: Optional[str]
statistics: Statistics

The statistics object contains information about query performance from the database, it does not include any network latency

bytes_read: float

Number of uncompressed bytes read from the table.

elapsed: float

Time in seconds for the query to run.

rows_read: float

Number of rows scanned from the table.

abr_level: Optional[float]

The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1

agents: Optional[List[Agent]]
agent_class: str
event_type_counts: Dict[str, float]
first_event_ms: float
has_errors: bool
last_event_ms: float
namespace: str
service: str
total_events: float
calculations: Optional[List[Calculation]]
aggregates: List[CalculationAggregate]
count: float
interval: float
sample_interval: float
value: float
groups: Optional[List[CalculationAggregateGroup]]
key: str
value: Union[str, float, bool]
One of the following:
str
float
bool
calculation: str
series: List[CalculationSeries]
data: List[CalculationSeriesData]
count: float
interval: float
sample_interval: float
value: float
first_seen: Optional[str]
groups: Optional[List[CalculationSeriesDataGroup]]
key: str
value: Union[str, float, bool]
One of the following:
str
float
bool
last_seen: Optional[str]
time: str
alias: Optional[str]
compare: Optional[List[Compare]]
aggregates: List[CompareAggregate]
count: float
interval: float
sample_interval: float
value: float
groups: Optional[List[CompareAggregateGroup]]
key: str
value: Union[str, float, bool]
One of the following:
str
float
bool
calculation: str
series: List[CompareSeries]
data: List[CompareSeriesData]
count: float
interval: float
sample_interval: float
value: float
first_seen: Optional[str]
groups: Optional[List[CompareSeriesDataGroup]]
key: str
value: Union[str, float, bool]
One of the following:
str
float
bool
last_seen: Optional[str]
time: str
alias: Optional[str]
events: Optional[Events]
count: Optional[float]
events: Optional[List[EventsEvent]]
metadata: EventsEventMetadata
id: str

Unique event ID. Use as the cursor for offset-based pagination.

account: Optional[str]
cloud_service: Optional[str]
cold_start: Optional[int]
exclusiveMinimum
minimum0
cost: Optional[int]
exclusiveMinimum
minimum0
duration: Optional[int]
exclusiveMinimum
minimum0
end_time: Optional[int]
minimum0
error: Optional[str]
error_template: Optional[str]
fingerprint: Optional[str]
level: Optional[str]
message: Optional[str]
message_template: Optional[str]
metric_name: Optional[str]
origin: Optional[str]
parent_span_id: Optional[str]
provider: Optional[str]
region: Optional[str]
request_id: Optional[str]
service: Optional[str]
span_id: Optional[str]
span_name: Optional[str]
stack_id: Optional[str]
start_time: Optional[int]
minimum0
status_code: Optional[int]
exclusiveMinimum
minimum0
trace_duration: Optional[int]
exclusiveMinimum
minimum0
trace_id: Optional[str]
transaction_name: Optional[str]
trigger: Optional[str]
type: Optional[str]
url: Optional[str]
dataset: str
source: Union[str, object]
One of the following:
str
object
timestamp: int
minimum0
containers: Optional[object]

Cloudflare Containers event information enriches your logs so you can easily identify and debug issues.

workers: Optional[EventsEventWorkers]

Cloudflare Workers event information enriches your logs so you can easily identify and debug issues.

One of the following:
class EventsEventWorkersUnionMember0:
event_type: Literal["fetch", "scheduled", "alarm", 8 more]
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"websocket"
"workflow"
"unknown"
request_id: str
script_name: str
durable_object_id: Optional[str]
entrypoint: Optional[str]
event: Optional[Dict[str, object]]
execution_model: Optional[Literal["durableObject", "stateless"]]
One of the following:
"durableObject"
"stateless"
outcome: Optional[str]
script_version: Optional[EventsEventWorkersUnionMember0ScriptVersion]
id: Optional[str]
message: Optional[str]
tag: Optional[str]
truncated: Optional[bool]
class EventsEventWorkersUnionMember1:
cpu_time_ms: float
event_type: Literal["fetch", "scheduled", "alarm", 8 more]
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"websocket"
"workflow"
"unknown"
outcome: str
request_id: str
script_name: str
wall_time_ms: float
diagnostics_channel_events: Optional[List[EventsEventWorkersUnionMember1DiagnosticsChannelEvent]]
channel: str
message: str
timestamp: float
dispatch_namespace: Optional[str]
durable_object_id: Optional[str]
entrypoint: Optional[str]
event: Optional[Dict[str, object]]
execution_model: Optional[Literal["durableObject", "stateless"]]
One of the following:
"durableObject"
"stateless"
script_version: Optional[EventsEventWorkersUnionMember1ScriptVersion]
id: Optional[str]
message: Optional[str]
tag: Optional[str]
truncated: Optional[bool]
fields: Optional[List[EventsField]]
key: str
type: str
series: Optional[List[EventsSeries]]
data: List[EventsSeriesData]
aggregates: EventsSeriesDataAggregates
Deprecated_count: int
exclusiveMinimum
minimum0
Deprecated_interval: float
exclusiveMinimum
minimum0
Deprecated_first_seen: Optional[str]
Deprecated_last_seen: Optional[str]
Deprecatedbin: Optional[object]
count: float
interval: float
sample_interval: float
errors: Optional[float]
groups: Optional[Dict[str, Union[str, float, bool]]]

Groups in the query results.

One of the following:
str
float
bool
time: str
invocations: Optional[Dict[str, List[Invocation]]]
metadata: InvocationMetadata
id: str

Unique event ID. Use as the cursor for offset-based pagination.

account: Optional[str]
cloud_service: Optional[str]
cold_start: Optional[int]
exclusiveMinimum
minimum0
cost: Optional[int]
exclusiveMinimum
minimum0
duration: Optional[int]
exclusiveMinimum
minimum0
end_time: Optional[int]
minimum0
error: Optional[str]
error_template: Optional[str]
fingerprint: Optional[str]
level: Optional[str]
message: Optional[str]
message_template: Optional[str]
metric_name: Optional[str]
origin: Optional[str]
parent_span_id: Optional[str]
provider: Optional[str]
region: Optional[str]
request_id: Optional[str]
service: Optional[str]
span_id: Optional[str]
span_name: Optional[str]
stack_id: Optional[str]
start_time: Optional[int]
minimum0
status_code: Optional[int]
exclusiveMinimum
minimum0
trace_duration: Optional[int]
exclusiveMinimum
minimum0
trace_id: Optional[str]
transaction_name: Optional[str]
trigger: Optional[str]
type: Optional[str]
url: Optional[str]
dataset: str
source: Union[str, object]
One of the following:
str
object
timestamp: int
minimum0
containers: Optional[object]

Cloudflare Containers event information enriches your logs so you can easily identify and debug issues.

workers: Optional[InvocationWorkers]

Cloudflare Workers event information enriches your logs so you can easily identify and debug issues.

One of the following:
class InvocationWorkersUnionMember0:
event_type: Literal["fetch", "scheduled", "alarm", 8 more]
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"websocket"
"workflow"
"unknown"
request_id: str
script_name: str
durable_object_id: Optional[str]
entrypoint: Optional[str]
event: Optional[Dict[str, object]]
execution_model: Optional[Literal["durableObject", "stateless"]]
One of the following:
"durableObject"
"stateless"
outcome: Optional[str]
script_version: Optional[InvocationWorkersUnionMember0ScriptVersion]
id: Optional[str]
message: Optional[str]
tag: Optional[str]
truncated: Optional[bool]
class InvocationWorkersUnionMember1:
cpu_time_ms: float
event_type: Literal["fetch", "scheduled", "alarm", 8 more]
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"websocket"
"workflow"
"unknown"
outcome: str
request_id: str
script_name: str
wall_time_ms: float
diagnostics_channel_events: Optional[List[InvocationWorkersUnionMember1DiagnosticsChannelEvent]]
channel: str
message: str
timestamp: float
dispatch_namespace: Optional[str]
durable_object_id: Optional[str]
entrypoint: Optional[str]
event: Optional[Dict[str, object]]
execution_model: Optional[Literal["durableObject", "stateless"]]
One of the following:
"durableObject"
"stateless"
script_version: Optional[InvocationWorkersUnionMember1ScriptVersion]
id: Optional[str]
message: Optional[str]
tag: Optional[str]
truncated: Optional[bool]
traces: Optional[List[Trace]]
root_span_name: str
root_transaction_name: str
service: List[str]
spans: float
trace_duration_ms: float
trace_end_ms: float
trace_id: str
trace_start_ms: float
errors: Optional[List[str]]

Run a query

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
response = client.workers.observability.telemetry.query(
    account_id="account_id",
    query_id="queryId",
    timeframe={
        "from": 0,
        "to": 0,
    },
)
print(response.run)
{
  "errors": [
    {
      "message": "message"
    }
  ],
  "messages": [
    {
      "message": "Successful request"
    }
  ],
  "result": {
    "run": {
      "id": "id",
      "accountId": "accountId",
      "dry": true,
      "granularity": 0,
      "query": {
        "id": "id",
        "adhoc": true,
        "created": "created",
        "createdBy": "createdBy",
        "description": "Query description",
        "name": "x",
        "parameters": {
          "calculations": [
            {
              "operator": "uniq",
              "alias": "alias",
              "key": "key",
              "keyType": "string"
            }
          ],
          "datasets": [
            "string"
          ],
          "filterCombination": "and",
          "filters": [
            {
              "filterCombination": "and",
              "filters": [
                {}
              ],
              "kind": "group"
            }
          ],
          "groupBys": [
            {
              "type": "string",
              "value": "value"
            }
          ],
          "havings": [
            {
              "key": "key",
              "operation": "eq",
              "value": 0
            }
          ],
          "limit": 0,
          "needle": {
            "value": {
              "0": "s",
              "1": "t",
              "2": "r",
              "3": "i",
              "4": "n",
              "5": "g"
            },
            "isRegex": true,
            "matchCase": true
          },
          "orderBy": {
            "value": "value",
            "order": "asc"
          }
        },
        "updated": "updated",
        "updatedBy": "updatedBy"
      },
      "status": "STARTED",
      "timeframe": {
        "from": 0,
        "to": 0
      },
      "userId": "userId",
      "created": "created",
      "statistics": {
        "bytes_read": 0,
        "elapsed": 0,
        "rows_read": 0,
        "abr_level": 0
      },
      "updated": "updated"
    },
    "statistics": {
      "bytes_read": 0,
      "elapsed": 0,
      "rows_read": 0,
      "abr_level": 0
    },
    "agents": [
      {
        "agentClass": "agentClass",
        "eventTypeCounts": {
          "foo": 0
        },
        "firstEventMs": 0,
        "hasErrors": true,
        "lastEventMs": 0,
        "namespace": "namespace",
        "service": "service",
        "totalEvents": 0
      }
    ],
    "calculations": [
      {
        "aggregates": [
          {
            "count": 0,
            "interval": 0,
            "sampleInterval": 0,
            "value": 0,
            "groups": [
              {
                "key": "key",
                "value": "string"
              }
            ]
          }
        ],
        "calculation": "calculation",
        "series": [
          {
            "data": [
              {
                "count": 0,
                "interval": 0,
                "sampleInterval": 0,
                "value": 0,
                "firstSeen": "firstSeen",
                "groups": [
                  {
                    "key": "key",
                    "value": "string"
                  }
                ],
                "lastSeen": "lastSeen"
              }
            ],
            "time": "time"
          }
        ],
        "alias": "alias"
      }
    ],
    "compare": [
      {
        "aggregates": [
          {
            "count": 0,
            "interval": 0,
            "sampleInterval": 0,
            "value": 0,
            "groups": [
              {
                "key": "key",
                "value": "string"
              }
            ]
          }
        ],
        "calculation": "calculation",
        "series": [
          {
            "data": [
              {
                "count": 0,
                "interval": 0,
                "sampleInterval": 0,
                "value": 0,
                "firstSeen": "firstSeen",
                "groups": [
                  {
                    "key": "key",
                    "value": "string"
                  }
                ],
                "lastSeen": "lastSeen"
              }
            ],
            "time": "time"
          }
        ],
        "alias": "alias"
      }
    ],
    "events": {
      "count": 0,
      "events": [
        {
          "$metadata": {
            "id": "id",
            "account": "account",
            "cloudService": "cloudService",
            "coldStart": 1,
            "cost": 1,
            "duration": 1,
            "endTime": 0,
            "error": "error",
            "errorTemplate": "errorTemplate",
            "fingerprint": "fingerprint",
            "level": "level",
            "message": "message",
            "messageTemplate": "messageTemplate",
            "metricName": "metricName",
            "origin": "origin",
            "parentSpanId": "parentSpanId",
            "provider": "provider",
            "region": "region",
            "requestId": "requestId",
            "service": "service",
            "spanId": "spanId",
            "spanName": "spanName",
            "stackId": "stackId",
            "startTime": 0,
            "statusCode": 1,
            "traceDuration": 1,
            "traceId": "traceId",
            "transactionName": "transactionName",
            "trigger": "trigger",
            "type": "type",
            "url": "url"
          },
          "dataset": "dataset",
          "source": "string",
          "timestamp": 0,
          "$containers": {},
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "truncated": true
          }
        }
      ],
      "fields": [
        {
          "key": "key",
          "type": "type"
        }
      ],
      "series": [
        {
          "data": [
            {
              "aggregates": {
                "_count": 1,
                "_interval": 1,
                "_firstSeen": "_firstSeen",
                "_lastSeen": "_lastSeen",
                "bin": {}
              },
              "count": 0,
              "interval": 0,
              "sampleInterval": 0,
              "errors": 0,
              "groups": {
                "foo": "string"
              }
            }
          ],
          "time": "time"
        }
      ]
    },
    "invocations": {
      "foo": [
        {
          "$metadata": {
            "id": "id",
            "account": "account",
            "cloudService": "cloudService",
            "coldStart": 1,
            "cost": 1,
            "duration": 1,
            "endTime": 0,
            "error": "error",
            "errorTemplate": "errorTemplate",
            "fingerprint": "fingerprint",
            "level": "level",
            "message": "message",
            "messageTemplate": "messageTemplate",
            "metricName": "metricName",
            "origin": "origin",
            "parentSpanId": "parentSpanId",
            "provider": "provider",
            "region": "region",
            "requestId": "requestId",
            "service": "service",
            "spanId": "spanId",
            "spanName": "spanName",
            "stackId": "stackId",
            "startTime": 0,
            "statusCode": 1,
            "traceDuration": 1,
            "traceId": "traceId",
            "transactionName": "transactionName",
            "trigger": "trigger",
            "type": "type",
            "url": "url"
          },
          "dataset": "dataset",
          "source": "string",
          "timestamp": 0,
          "$containers": {},
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "truncated": true
          }
        }
      ]
    },
    "traces": [
      {
        "rootSpanName": "rootSpanName",
        "rootTransactionName": "rootTransactionName",
        "service": [
          "string"
        ],
        "spans": 0,
        "traceDurationMs": 0,
        "traceEndMs": 0,
        "traceId": "traceId",
        "traceStartMs": 0,
        "errors": [
          "string"
        ]
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "message": "message"
    }
  ],
  "messages": [
    {
      "message": "Successful request"
    }
  ],
  "result": {
    "run": {
      "id": "id",
      "accountId": "accountId",
      "dry": true,
      "granularity": 0,
      "query": {
        "id": "id",
        "adhoc": true,
        "created": "created",
        "createdBy": "createdBy",
        "description": "Query description",
        "name": "x",
        "parameters": {
          "calculations": [
            {
              "operator": "uniq",
              "alias": "alias",
              "key": "key",
              "keyType": "string"
            }
          ],
          "datasets": [
            "string"
          ],
          "filterCombination": "and",
          "filters": [
            {
              "filterCombination": "and",
              "filters": [
                {}
              ],
              "kind": "group"
            }
          ],
          "groupBys": [
            {
              "type": "string",
              "value": "value"
            }
          ],
          "havings": [
            {
              "key": "key",
              "operation": "eq",
              "value": 0
            }
          ],
          "limit": 0,
          "needle": {
            "value": {
              "0": "s",
              "1": "t",
              "2": "r",
              "3": "i",
              "4": "n",
              "5": "g"
            },
            "isRegex": true,
            "matchCase": true
          },
          "orderBy": {
            "value": "value",
            "order": "asc"
          }
        },
        "updated": "updated",
        "updatedBy": "updatedBy"
      },
      "status": "STARTED",
      "timeframe": {
        "from": 0,
        "to": 0
      },
      "userId": "userId",
      "created": "created",
      "statistics": {
        "bytes_read": 0,
        "elapsed": 0,
        "rows_read": 0,
        "abr_level": 0
      },
      "updated": "updated"
    },
    "statistics": {
      "bytes_read": 0,
      "elapsed": 0,
      "rows_read": 0,
      "abr_level": 0
    },
    "agents": [
      {
        "agentClass": "agentClass",
        "eventTypeCounts": {
          "foo": 0
        },
        "firstEventMs": 0,
        "hasErrors": true,
        "lastEventMs": 0,
        "namespace": "namespace",
        "service": "service",
        "totalEvents": 0
      }
    ],
    "calculations": [
      {
        "aggregates": [
          {
            "count": 0,
            "interval": 0,
            "sampleInterval": 0,
            "value": 0,
            "groups": [
              {
                "key": "key",
                "value": "string"
              }
            ]
          }
        ],
        "calculation": "calculation",
        "series": [
          {
            "data": [
              {
                "count": 0,
                "interval": 0,
                "sampleInterval": 0,
                "value": 0,
                "firstSeen": "firstSeen",
                "groups": [
                  {
                    "key": "key",
                    "value": "string"
                  }
                ],
                "lastSeen": "lastSeen"
              }
            ],
            "time": "time"
          }
        ],
        "alias": "alias"
      }
    ],
    "compare": [
      {
        "aggregates": [
          {
            "count": 0,
            "interval": 0,
            "sampleInterval": 0,
            "value": 0,
            "groups": [
              {
                "key": "key",
                "value": "string"
              }
            ]
          }
        ],
        "calculation": "calculation",
        "series": [
          {
            "data": [
              {
                "count": 0,
                "interval": 0,
                "sampleInterval": 0,
                "value": 0,
                "firstSeen": "firstSeen",
                "groups": [
                  {
                    "key": "key",
                    "value": "string"
                  }
                ],
                "lastSeen": "lastSeen"
              }
            ],
            "time": "time"
          }
        ],
        "alias": "alias"
      }
    ],
    "events": {
      "count": 0,
      "events": [
        {
          "$metadata": {
            "id": "id",
            "account": "account",
            "cloudService": "cloudService",
            "coldStart": 1,
            "cost": 1,
            "duration": 1,
            "endTime": 0,
            "error": "error",
            "errorTemplate": "errorTemplate",
            "fingerprint": "fingerprint",
            "level": "level",
            "message": "message",
            "messageTemplate": "messageTemplate",
            "metricName": "metricName",
            "origin": "origin",
            "parentSpanId": "parentSpanId",
            "provider": "provider",
            "region": "region",
            "requestId": "requestId",
            "service": "service",
            "spanId": "spanId",
            "spanName": "spanName",
            "stackId": "stackId",
            "startTime": 0,
            "statusCode": 1,
            "traceDuration": 1,
            "traceId": "traceId",
            "transactionName": "transactionName",
            "trigger": "trigger",
            "type": "type",
            "url": "url"
          },
          "dataset": "dataset",
          "source": "string",
          "timestamp": 0,
          "$containers": {},
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "truncated": true
          }
        }
      ],
      "fields": [
        {
          "key": "key",
          "type": "type"
        }
      ],
      "series": [
        {
          "data": [
            {
              "aggregates": {
                "_count": 1,
                "_interval": 1,
                "_firstSeen": "_firstSeen",
                "_lastSeen": "_lastSeen",
                "bin": {}
              },
              "count": 0,
              "interval": 0,
              "sampleInterval": 0,
              "errors": 0,
              "groups": {
                "foo": "string"
              }
            }
          ],
          "time": "time"
        }
      ]
    },
    "invocations": {
      "foo": [
        {
          "$metadata": {
            "id": "id",
            "account": "account",
            "cloudService": "cloudService",
            "coldStart": 1,
            "cost": 1,
            "duration": 1,
            "endTime": 0,
            "error": "error",
            "errorTemplate": "errorTemplate",
            "fingerprint": "fingerprint",
            "level": "level",
            "message": "message",
            "messageTemplate": "messageTemplate",
            "metricName": "metricName",
            "origin": "origin",
            "parentSpanId": "parentSpanId",
            "provider": "provider",
            "region": "region",
            "requestId": "requestId",
            "service": "service",
            "spanId": "spanId",
            "spanName": "spanName",
            "stackId": "stackId",
            "startTime": 0,
            "statusCode": 1,
            "traceDuration": 1,
            "traceId": "traceId",
            "transactionName": "transactionName",
            "trigger": "trigger",
            "type": "type",
            "url": "url"
          },
          "dataset": "dataset",
          "source": "string",
          "timestamp": 0,
          "$containers": {},
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "truncated": true
          }
        }
      ]
    },
    "traces": [
      {
        "rootSpanName": "rootSpanName",
        "rootTransactionName": "rootTransactionName",
        "service": [
          "string"
        ],
        "spans": 0,
        "traceDurationMs": 0,
        "traceEndMs": 0,
        "traceId": "traceId",
        "traceStartMs": 0,
        "errors": [
          "string"
        ]
      }
    ]
  },
  "success": true
}