Skip to content
Start here

View a query that has been shared

client.workers.observability.sharedQueries.get(stringid, SharedQueryGetParams { account_id, view } params, RequestOptionsoptions?): SharedQueryGetResponse { run, statistics, agents, 6 more }
GET/accounts/{account_id}/workers/observability/shared/query/{id}

Shared queries store the results of a previously run query, allowing you to share the results with others.

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 WriteWorkers Observability Read
ParametersExpand Collapse
id: string

Specify the ID of the shared query.

params: SharedQueryGetParams { account_id, view }
account_id: string

Path param: Your Cloudflare account ID.

view?: "events" | "invocations" | "calculations"

Query param: Select the view of the query result to return, defaults to events.

One of the following:
"events"
"invocations"
"calculations"
ReturnsExpand Collapse
SharedQueryGetResponse { run, statistics, agents, 6 more }

Complete results of a query run. The populated fields depend on the requested view type (events, calculations, invocations, traces, or agents).

run: Run { id, accountId, dry, 8 more }

Represents a single execution of a query against Workers Observability data, including the query definition, execution status, and performance statistics.

id: string

Unique identifier for this query run.

accountId: string

Cloudflare account ID that owns this query run.

dry: boolean

Whether this was a dry run (results not persisted).

granularity: number

Number of time-series buckets used for the query. Higher values produce more detailed series data.

query: Query { id, adhoc, created, 6 more }

A saved query definition with its parameters, metadata, and ownership information.

id: string
adhoc: boolean

If the query wasn’t explcitly saved

created: string
createdBy: string
description: string | null
maxLength1000
name: string

Query name

maxLength250
minLength1
parameters: Parameters { calculations, datasets, filterCombination, 6 more }
calculations?: Array<UnionMember0 { operator, alias, key, keyType } | UnionMember1 { key, operator, alias, keyType } >

Create Calculations to compute as part of the query.

One of the following:
UnionMember0 { operator, alias, key, keyType }
operator: "count" | "COUNT"
One of the following:
"count"
"COUNT"
alias?: string
key?: string
keyType?: "string" | "number" | "boolean"
One of the following:
"string"
"number"
"boolean"
UnionMember1 { key, operator, alias, keyType }
key: string
operator: "uniq" | "max" | "min" | 33 more
One of the following:
"uniq"
"max"
"min"
"sum"
"avg"
"median"
"p001"
"p01"
"p05"
"p10"
"p25"
"p75"
"p90"
"p95"
"p99"
"p999"
"stddev"
"variance"
"COUNT_DISTINCT"
"MAX"
"MIN"
"SUM"
"AVG"
"MEDIAN"
"P001"
"P01"
"P05"
"P10"
"P25"
"P75"
"P90"
"P95"
"P99"
"P999"
"STDDEV"
"VARIANCE"
alias?: string
keyType?: "string" | "number" | "boolean"
One of the following:
"string"
"number"
"boolean"
datasets?: Array<string>

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

filterCombination?: "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?: Array<UnionMember0 { filterCombination, filters, kind } | WorkersObservabilityFilterLeaf { key, operation, type, 2 more } >

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

One of the following:
UnionMember0 { filterCombination, filters, kind }
filterCombination: "and" | "or" | "AND" | "OR"
One of the following:
"and"
"or"
"AND"
"OR"
filters: Array<unknown>
kind: "group"
WorkersObservabilityFilterLeaf { key, operation, type, 2 more }

A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters.

key: string

Filter field name. Use verified keys from previous query results or the keys endpoint. Common keys include $metadata.service, $metadata.origin, $metadata.trigger, $metadata.message, and $metadata.error.

operation: "includes" | "not_includes" | "starts_with" | 27 more

Comparison operator. String operators: includes, not_includes, starts_with, ends_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte.

One of the following:
"includes"
"not_includes"
"starts_with"
"ends_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"
"ENDS_WITH"
type: "string" | "number" | "boolean"

Data type of the filter field. Must match the actual type of the key being filtered.

One of the following:
"string"
"number"
"boolean"
kind?: "filter"

Discriminator for leaf filter nodes. Always ‘filter’ when present; may be omitted.

value?: string | number | boolean

Comparison value. Must match actual values in your data — verify with the values endpoint. Ensure the value type (string/number/boolean) matches the field type. String comparisons are case-sensitive. Regex uses RE2 syntax (no lookaheads/lookbehinds).

One of the following:
string
number
boolean
groupBys?: Array<GroupBy>

Define how to group the results of the query.

type: "string" | "number" | "boolean"
One of the following:
"string"
"number"
"boolean"
value: string
havings?: Array<Having>

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

key: string
operation: "eq" | "neq" | "gt" | 3 more
One of the following:
"eq"
"neq"
"gt"
"gte"
"lt"
"lte"
value: number
limit?: number

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

maximum100
minimum0
needle?: Needle { value, isRegex, matchCase }

Define an expression to search using full-text search.

value: Value
isRegex?: boolean
matchCase?: boolean
orderBy?: OrderBy { value, order }

Configure the order of the results returned by the query.

value: string

Configure which Calculation to order the results by.

order?: "asc" | "desc"

Set the order of the results

One of the following:
"asc"
"desc"
updated: string
updatedBy: string
status: "STARTED" | "COMPLETED"

Current execution status of the query run.

One of the following:
"STARTED"
"COMPLETED"
timeframe: Timeframe { from, to }

Time range for the query execution

from: number

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

to: number

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

userId: string

ID of the user who initiated the query run.

created?: string

ISO-8601 timestamp when the query run was created.

statistics?: Statistics { bytes_read, elapsed, rows_read, abr_level }

Query performance statistics from the database (does not include network latency).

bytes_read: number

Number of uncompressed bytes read from the table.

elapsed: number

Time in seconds for the query to run.

rows_read: number

Number of rows scanned from the table.

abr_level?: number

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

updated?: string

ISO-8601 timestamp when the query run was last updated.

statistics: Statistics { bytes_read, elapsed, rows_read, abr_level }

Query performance statistics from the database. Includes execution time, rows scanned, and bytes read. Does not include network latency.

bytes_read: number

Number of uncompressed bytes read from the table.

elapsed: number

Time in seconds for the query to run.

rows_read: number

Number of rows scanned from the table.

abr_level?: number

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

agents?: Array<Agent>

Agent run summaries. Present when the query view is ‘agents’. Each entry represents one trace containing at least one agent invocation.

id: string

Pagination cursor derived from the first agent invocation in the run.

errors: Array<string>

Distinct errors reported by spans in the run.

models: Array<string>

Distinct models reported by chat spans across the run’s trace.

providers: Array<string>

Distinct GenAI providers reported by chat spans in the run.

services: Array<string>

Worker services represented in the run’s trace.

spans: number

Number of spans in the run’s trace.

status: "completed" | "error"

Observed run status.

One of the following:
"completed"
"error"
traceDurationMs: number

Total trace duration in milliseconds.

traceEndMs: number

End of the run’s trace as a Unix epoch in milliseconds.

traceId: string

Trace identifier for this agent run.

traceStartMs: number

Start of the run’s trace as a Unix epoch in milliseconds.

agentId?: string

ID from the earliest agent invocation that provides one.

agentName?: string

Name from the earliest agent invocation that provides one.

conversationId?: string

Conversation ID from the earliest invocation that provides one.

inputTokens?: number

Input tokens summed across chat spans in the run’s trace; informational, not billing data.

outputTokens?: number

Output tokens summed across chat spans in the run’s trace; informational, not billing data.

calculations?: Array<Calculation>

Aggregated calculation results. Present when the query view is ‘calculations’. Contains computed metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series data.

aggregates: Array<Aggregate>
count: number
interval: number
sampleInterval: number
value: number
groups?: Array<Group>
key: string
value: string | number | boolean
One of the following:
string
number
boolean
calculation: string
series: Array<Series>
data: Array<Data>
count: number
interval: number
sampleInterval: number
value: number
firstSeen?: string
groups?: Array<Group>
key: string
value: string | number | boolean
One of the following:
string
number
boolean
lastSeen?: string
time: string
alias?: string
compare?: Array<Compare>

Comparison calculation results from the previous time period. Present when the compare option is enabled. Same structure as calculations.

aggregates: Array<Aggregate>
count: number
interval: number
sampleInterval: number
value: number
groups?: Array<Group>
key: string
value: string | number | boolean
One of the following:
string
number
boolean
calculation: string
series: Array<Series>
data: Array<Data>
count: number
interval: number
sampleInterval: number
value: number
firstSeen?: string
groups?: Array<Group>
key: string
value: string | number | boolean
One of the following:
string
number
boolean
lastSeen?: string
time: string
alias?: string
distribution?: Distribution { bins, bucketBoundaries, bucketMode, 2 more }

Bucketed 2D histogram of a numeric field over time. Present when chartType is ‘distribution’.

bins: Array<string>

Time-bucket labels (ISO-8601 strings), one per matrix column.

bucketBoundaries: Array<number>

Raw bucket edges in the value’s native unit, length buckets.length + 1. Used for the colour scale and percentile mapping.

bucketMode: "log" | "linear"

Bucketing scheme used to derive the boundaries. ‘log’ produces geometric edges; ‘linear’ produces fixed-width edges.

One of the following:
"log"
"linear"
buckets: Array<string>

Value-range labels, one per matrix row (e.g. ‘50–100ms’).

matrix: Array<Array<number>>

Sampling-corrected counts. matrix[bucketIdx][binIdx] is the estimated number of events in value-bucket ‘bucketIdx’ during time-bin ‘binIdx’.

events?: Events { count, events, fields, series }

Individual event results. Present when the query view is ‘events’. Contains the matching log lines and their metadata.

count?: number

Total number of events matching the query (may exceed the number returned due to limits).

events?: Array<Event>

List of individual telemetry events matching the query.

"$metadata": Metadata { id, account, cloudService, 29 more }

Structured metadata extracted from the event. These fields are indexed and available for filtering and aggregation.

id: string

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

account?: string

Cloudflare account identifier.

cloudService?: string

Cloudflare product that generated this event (e.g. workers, pages).

coldStart?: number
exclusiveMinimum
minimum0
cost?: number

Estimated cost units for this invocation.

exclusiveMinimum
minimum0
duration?: number

Span duration in milliseconds.

exclusiveMinimum
minimum0
endTime?: number

Span end time as a Unix epoch in milliseconds.

minimum0
error?: string

Error message, present when the log represents an error.

errorTemplate?: string

Templatized version of the error message used for grouping similar errors.

fingerprint?: string

Content-based fingerprint used to group similar events.

level?: string

Log level (e.g. log, debug, info, warn, error).

message?: string

Log message text.

messageTemplate?: string

Templatized version of the log message used for grouping similar messages.

metricName?: string

Metric name when the event represents a metric data point.

origin?: string

Origin of the event (e.g. fetch, scheduled, queue).

parentSpanId?: string

Span ID of the parent span in the trace hierarchy.

provider?: string

Infrastructure provider identifier.

rayId?: string

Cloudflare Ray ID from the cf-ray header of the request that triggered the invocation.

region?: string

Cloudflare data center / region that handled the request.

requestId?: string

Cloudflare request ID that ties all logs from a single invocation together.

service?: string

Worker script name that produced this event.

spanId?: string

Span ID for this individual unit of work within a trace.

spanName?: string

Human-readable name for this span.

stackId?: string

Stack / deployment identifier.

startTime?: number

Span start time as a Unix epoch in milliseconds.

minimum0
statusCode?: number

HTTP response status code returned by the Worker.

exclusiveMinimum
minimum0
traceDuration?: number

Total duration of the entire trace in milliseconds.

exclusiveMinimum
minimum0
traceId?: string

Distributed trace ID linking spans across services.

transactionName?: string

Logical transaction name for this request.

trigger?: string

What triggered the invocation (e.g. GET /users, POST /orders, queue message).

type?: string

Event type classifier (e.g. cf-worker-event, cf-worker-log).

url?: string

Request URL that triggered the Worker invocation.

dataset: string

The dataset this event belongs to (e.g. cloudflare-workers).

source: string | Record<string, unknown>

Raw log payload. May be a string or a structured object depending on how the log was emitted.

One of the following:
string
Record<string, unknown>
timestamp: number

Event timestamp as a Unix epoch in milliseconds.

minimum0
"$containers"?: Record<string, unknown>

Cloudflare Containers event information that enriches your logs for identifying and debugging issues.

"$workers"?: UnionMember0 { eventType, requestId, scriptName, 10 more } | UnionMember1 { cpuTimeMs, eventType, outcome, 14 more }

Cloudflare Workers event information that enriches your logs for identifying and debugging issues.

One of the following:
UnionMember0 { eventType, requestId, scriptName, 10 more }
eventType: "fetch" | "scheduled" | "alarm" | 9 more
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"jsrpc"
"websocket"
"workflow"
"unknown"
requestId: string
scriptName: string
durableObjectId?: string
entrypoint?: string
event?: Record<string, unknown>
executionModel?: "durableObject" | "stateless"
One of the following:
"durableObject"
"stateless"
outcome?: string
preview?: Preview { id, name, slug }
id?: string
name?: string
slug?: string
scriptVersion?: ScriptVersion { id, message, tag }
id?: string
message?: string
tag?: string
spanId?: string
traceId?: string
truncated?: boolean
UnionMember1 { cpuTimeMs, eventType, outcome, 14 more }
cpuTimeMs: number
eventType: "fetch" | "scheduled" | "alarm" | 9 more
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"jsrpc"
"websocket"
"workflow"
"unknown"
outcome: string
requestId: string
scriptName: string
wallTimeMs: number
diagnosticsChannelEvents?: Array<DiagnosticsChannelEvent>
channel: string
message: string
timestamp: number
dispatchNamespace?: string
durableObjectId?: string
entrypoint?: string
event?: Record<string, unknown>
executionModel?: "durableObject" | "stateless"
One of the following:
"durableObject"
"stateless"
preview?: Preview { id, name, slug }
id?: string
name?: string
slug?: string
scriptVersion?: ScriptVersion { id, message, tag }
id?: string
message?: string
tag?: string
spanId?: string
traceId?: string
truncated?: boolean
fields?: Array<Field>

List of fields discovered in the matched events. Useful for building dynamic UIs.

key: string

Field name present in the matched events.

type: string

Data type of the field (string, number, or boolean).

series?: Array<Series>

Time-series data for the matched events, bucketed by the query granularity.

data: Array<Data>
aggregates: Aggregates { _count, _interval, _firstSeen, 2 more }
Deprecated_count: number
exclusiveMinimum
minimum0
Deprecated_interval: number
exclusiveMinimum
minimum0
Deprecated_firstSeen?: string
Deprecated_lastSeen?: string
Deprecatedbin?: unknown
count: number
interval: number
sampleInterval: number
errors?: number
groups?: Record<string, string | number | boolean>

Groups in the query results.

One of the following:
string
number
boolean
time: string
invocations?: Record<string, Array<Invocation>>

Events grouped by invocation (request ID). Present when the query view is ‘invocations’. Each key is a request ID mapping to all events from that invocation.

"$metadata": Metadata { id, account, cloudService, 29 more }

Structured metadata extracted from the event. These fields are indexed and available for filtering and aggregation.

id: string

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

account?: string

Cloudflare account identifier.

cloudService?: string

Cloudflare product that generated this event (e.g. workers, pages).

coldStart?: number
exclusiveMinimum
minimum0
cost?: number

Estimated cost units for this invocation.

exclusiveMinimum
minimum0
duration?: number

Span duration in milliseconds.

exclusiveMinimum
minimum0
endTime?: number

Span end time as a Unix epoch in milliseconds.

minimum0
error?: string

Error message, present when the log represents an error.

errorTemplate?: string

Templatized version of the error message used for grouping similar errors.

fingerprint?: string

Content-based fingerprint used to group similar events.

level?: string

Log level (e.g. log, debug, info, warn, error).

message?: string

Log message text.

messageTemplate?: string

Templatized version of the log message used for grouping similar messages.

metricName?: string

Metric name when the event represents a metric data point.

origin?: string

Origin of the event (e.g. fetch, scheduled, queue).

parentSpanId?: string

Span ID of the parent span in the trace hierarchy.

provider?: string

Infrastructure provider identifier.

rayId?: string

Cloudflare Ray ID from the cf-ray header of the request that triggered the invocation.

region?: string

Cloudflare data center / region that handled the request.

requestId?: string

Cloudflare request ID that ties all logs from a single invocation together.

service?: string

Worker script name that produced this event.

spanId?: string

Span ID for this individual unit of work within a trace.

spanName?: string

Human-readable name for this span.

stackId?: string

Stack / deployment identifier.

startTime?: number

Span start time as a Unix epoch in milliseconds.

minimum0
statusCode?: number

HTTP response status code returned by the Worker.

exclusiveMinimum
minimum0
traceDuration?: number

Total duration of the entire trace in milliseconds.

exclusiveMinimum
minimum0
traceId?: string

Distributed trace ID linking spans across services.

transactionName?: string

Logical transaction name for this request.

trigger?: string

What triggered the invocation (e.g. GET /users, POST /orders, queue message).

type?: string

Event type classifier (e.g. cf-worker-event, cf-worker-log).

url?: string

Request URL that triggered the Worker invocation.

dataset: string

The dataset this event belongs to (e.g. cloudflare-workers).

source: string | Record<string, unknown>

Raw log payload. May be a string or a structured object depending on how the log was emitted.

One of the following:
string
Record<string, unknown>
timestamp: number

Event timestamp as a Unix epoch in milliseconds.

minimum0
"$containers"?: Record<string, unknown>

Cloudflare Containers event information that enriches your logs for identifying and debugging issues.

"$workers"?: UnionMember0 { eventType, requestId, scriptName, 10 more } | UnionMember1 { cpuTimeMs, eventType, outcome, 14 more }

Cloudflare Workers event information that enriches your logs for identifying and debugging issues.

One of the following:
UnionMember0 { eventType, requestId, scriptName, 10 more }
eventType: "fetch" | "scheduled" | "alarm" | 9 more
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"jsrpc"
"websocket"
"workflow"
"unknown"
requestId: string
scriptName: string
durableObjectId?: string
entrypoint?: string
event?: Record<string, unknown>
executionModel?: "durableObject" | "stateless"
One of the following:
"durableObject"
"stateless"
outcome?: string
preview?: Preview { id, name, slug }
id?: string
name?: string
slug?: string
scriptVersion?: ScriptVersion { id, message, tag }
id?: string
message?: string
tag?: string
spanId?: string
traceId?: string
truncated?: boolean
UnionMember1 { cpuTimeMs, eventType, outcome, 14 more }
cpuTimeMs: number
eventType: "fetch" | "scheduled" | "alarm" | 9 more
One of the following:
"fetch"
"scheduled"
"alarm"
"cron"
"queue"
"email"
"tail"
"rpc"
"jsrpc"
"websocket"
"workflow"
"unknown"
outcome: string
requestId: string
scriptName: string
wallTimeMs: number
diagnosticsChannelEvents?: Array<DiagnosticsChannelEvent>
channel: string
message: string
timestamp: number
dispatchNamespace?: string
durableObjectId?: string
entrypoint?: string
event?: Record<string, unknown>
executionModel?: "durableObject" | "stateless"
One of the following:
"durableObject"
"stateless"
preview?: Preview { id, name, slug }
id?: string
name?: string
slug?: string
scriptVersion?: ScriptVersion { id, message, tag }
id?: string
message?: string
tag?: string
spanId?: string
traceId?: string
truncated?: boolean
traces?: Array<Trace>

Trace summaries matching the query. Present when the query view is ‘traces’. Each entry represents a distributed trace with its spans, duration, and services involved.

rootSpanName: string

Name of the root span that initiated the trace.

rootTransactionName: string

Logical transaction name for the root span.

service: Array<string>

List of Worker services involved in the trace.

spans: number

Total number of spans in the trace.

traceDurationMs: number

Total duration of the trace in milliseconds.

traceEndMs: number

Trace end time as a Unix epoch in milliseconds.

traceId: string

Unique identifier for the distributed trace.

traceStartMs: number

Trace start time as a Unix epoch in milliseconds.

errors?: Array<string>

Error messages encountered during the trace, if any.

View a query that has been shared

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

const sharedQuery = await client.workers.observability.sharedQueries.get('id', {
  account_id: 'account_id',
});

console.log(sharedQuery.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": "count",
              "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": [
      {
        "id": "id",
        "errors": [
          "string"
        ],
        "models": [
          "string"
        ],
        "providers": [
          "string"
        ],
        "services": [
          "string"
        ],
        "spans": 0,
        "status": "completed",
        "traceDurationMs": 0,
        "traceEndMs": 0,
        "traceId": "traceId",
        "traceStartMs": 0,
        "agentId": "agentId",
        "agentName": "agentName",
        "conversationId": "conversationId",
        "inputTokens": 0,
        "outputTokens": 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"
      }
    ],
    "distribution": {
      "bins": [
        "string"
      ],
      "bucketBoundaries": [
        0
      ],
      "bucketMode": "log",
      "buckets": [
        "string"
      ],
      "matrix": [
        [
          0
        ]
      ]
    },
    "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",
            "rayId": "rayId",
            "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": {
            "foo": "bar"
          },
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "preview": {
              "id": "id",
              "name": "name",
              "slug": "slug"
            },
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "spanId": "spanId",
            "traceId": "traceId",
            "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",
            "rayId": "rayId",
            "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": {
            "foo": "bar"
          },
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "preview": {
              "id": "id",
              "name": "name",
              "slug": "slug"
            },
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "spanId": "spanId",
            "traceId": "traceId",
            "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": "count",
              "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": [
      {
        "id": "id",
        "errors": [
          "string"
        ],
        "models": [
          "string"
        ],
        "providers": [
          "string"
        ],
        "services": [
          "string"
        ],
        "spans": 0,
        "status": "completed",
        "traceDurationMs": 0,
        "traceEndMs": 0,
        "traceId": "traceId",
        "traceStartMs": 0,
        "agentId": "agentId",
        "agentName": "agentName",
        "conversationId": "conversationId",
        "inputTokens": 0,
        "outputTokens": 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"
      }
    ],
    "distribution": {
      "bins": [
        "string"
      ],
      "bucketBoundaries": [
        0
      ],
      "bucketMode": "log",
      "buckets": [
        "string"
      ],
      "matrix": [
        [
          0
        ]
      ]
    },
    "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",
            "rayId": "rayId",
            "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": {
            "foo": "bar"
          },
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "preview": {
              "id": "id",
              "name": "name",
              "slug": "slug"
            },
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "spanId": "spanId",
            "traceId": "traceId",
            "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",
            "rayId": "rayId",
            "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": {
            "foo": "bar"
          },
          "$workers": {
            "eventType": "fetch",
            "requestId": "requestId",
            "scriptName": "scriptName",
            "durableObjectId": "durableObjectId",
            "entrypoint": "entrypoint",
            "event": {
              "foo": "bar"
            },
            "executionModel": "durableObject",
            "outcome": "outcome",
            "preview": {
              "id": "id",
              "name": "name",
              "slug": "slug"
            },
            "scriptVersion": {
              "id": "id",
              "message": "message",
              "tag": "tag"
            },
            "spanId": "spanId",
            "traceId": "traceId",
            "truncated": true
          }
        }
      ]
    },
    "traces": [
      {
        "rootSpanName": "rootSpanName",
        "rootTransactionName": "rootTransactionName",
        "service": [
          "string"
        ],
        "spans": 0,
        "traceDurationMs": 0,
        "traceEndMs": 0,
        "traceId": "traceId",
        "traceStartMs": 0,
        "errors": [
          "string"
        ]
      }
    ]
  },
  "success": true
}