# Observability # Telemetry ## List keys **post** `/accounts/{account_id}/workers/observability/telemetry/keys` List all the keys in your telemetry events. ### Path Parameters - `account_id: string` ### Body Parameters - `datasets: optional array of string` Leave this empty to use the default datasets - `filters: optional array of { filterCombination, filters, kind } or { key, operation, type, 2 more }` Apply filters to narrow key discovery. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. - `{ filterCombination, filters, kind }` - `filterCombination: "and" or "or" or "AND" or "OR"` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: array of unknown` - `kind: "group"` - `"group"` - `WorkersObservabilityFilterLeaf { key, operation, type, 2 more }` 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: string` 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: "includes" or "not_includes" or "starts_with" or 25 more` - `"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: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `kind: optional "filter"` - `"filter"` - `value: optional string or number or boolean` 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. - `string` - `number` - `boolean` - `from: optional number` - `keyNeedle: optional { value, isRegex, matchCase }` If the user suggests a key, use this to narrow down the list of keys returned. Make sure matchCase is false to avoid case sensitivity issues. - `value: string or number or boolean` - `string` - `number` - `boolean` - `isRegex: optional boolean` - `matchCase: optional boolean` - `limit: optional number` Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering. - `needle: optional { value, isRegex, matchCase }` Search for a specific substring in any of the events - `value: string or number or boolean` - `string` - `number` - `boolean` - `isRegex: optional boolean` - `matchCase: optional boolean` - `to: optional number` ### Returns - `errors: array of { message }` - `message: string` - `messages: array of { message }` - `message: "Successful request"` - `"Successful request"` - `result: array of { key, lastSeenAt, type }` - `key: string` - `lastSeenAt: number` - `type: "string" or "boolean" or "number"` - `"string"` - `"boolean"` - `"number"` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/observability/telemetry/keys \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{}' ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "Successful request" } ], "result": [ { "key": "key", "lastSeenAt": 0, "type": "string" } ], "success": true } ``` ## Run a query **post** `/accounts/{account_id}/workers/observability/telemetry/query` Run a temporary or saved query. ### Path Parameters - `account_id: string` ### Body Parameters - `queryId: string` Unique identifier for the query to execute - `timeframe: { from, to }` Timeframe for your query using Unix timestamps in milliseconds. Provide from/to epoch ms; narrower timeframes provide faster responses and more specific results. - `from: number` Start timestamp for the query timeframe (Unix timestamp in milliseconds) - `to: number` End timestamp for the query timeframe (Unix timestamp in milliseconds) - `chart: optional boolean` Whether to include timeseties data in the response - `compare: optional boolean` Whether to include comparison data with previous time periods - `dry: optional boolean` Whether to perform a dry run without saving the results of the query. Useful for validation - `granularity: optional number` This is only used when the view is calculations. Leaving it empty lets Workers Observability detect the correct granularity. - `ignoreSeries: optional boolean` Whether to ignore time-series data in the results and return only aggregated values - `limit: optional number` Use this limit to cap the number of events returned when the view is events. - `offset: optional string` Cursor pagination for event/trace/invocation views. Pass the last item's $metadata.id as the next offset. - `offsetBy: optional number` Numeric offset for pattern results (top-N list). Use with limit to page pattern groups; not used by cursor pagination. - `offsetDirection: optional string` Direction for offset-based pagination (e.g., 'next', 'prev') - `parameters: optional { calculations, datasets, filterCombination, 6 more }` Optional parameters to pass to the query execution - `calculations: optional array of { operator, alias, key, keyType }` Create Calculations to compute as part of the query. - `operator: "uniq" or "count" or "max" or 35 more` - `"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 string` - `key: optional string` 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. - `keyType: optional "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `datasets: optional array of string` Set the Datasets to query. Leave it empty to query all the datasets. - `filterCombination: optional "and" or "or" or "AND" or "OR"` Set a Flag to describe how to combine the filters on the query. - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: optional array of { filterCombination, filters, kind } or { key, operation, type, 2 more }` Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. - `{ filterCombination, filters, kind }` - `filterCombination: "and" or "or" or "AND" or "OR"` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: array of unknown` - `kind: "group"` - `"group"` - `WorkersObservabilityFilterLeaf { key, operation, type, 2 more }` 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: string` 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: "includes" or "not_includes" or "starts_with" or 25 more` - `"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: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `kind: optional "filter"` - `"filter"` - `value: optional string or number or boolean` 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. - `string` - `number` - `boolean` - `groupBys: optional array of { type, value }` Define how to group the results of the query. - `type: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `value: string` - `havings: optional array of { key, operation, value }` Configure the Having clauses that filter on calculations in the query result. - `key: string` - `operation: "eq" or "neq" or "gt" or 3 more` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `value: number` - `limit: optional number` Set a limit on the number of results / records returned by the query - `needle: optional { value, isRegex, matchCase }` Define an expression to search using full-text search. - `value: string or number or boolean` - `string` - `number` - `boolean` - `isRegex: optional boolean` - `matchCase: optional boolean` - `orderBy: optional { value, order }` Configure the order of the results returned by the query. - `value: string` Configure which Calculation to order the results by. - `order: optional "asc" or "desc"` Set the order of the results - `"asc"` - `"desc"` - `view: optional "traces" or "events" or "calculations" or 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. - `"traces"` - `"events"` - `"calculations"` - `"invocations"` - `"requests"` - `"agents"` ### Returns - `errors: array of { message }` - `message: string` - `messages: array of { message }` - `message: "Successful request"` - `"Successful request"` - `result: { run, statistics, agents, 5 more }` - `run: { id, accountId, dry, 8 more }` A Workers Observability Query Object - `id: string` - `accountId: string` - `dry: boolean` - `granularity: number` - `query: { id, adhoc, created, 6 more }` - `id: string` - `adhoc: boolean` If the query wasn't explcitly saved - `created: string` - `createdBy: string` - `description: string` - `name: string` Query name - `parameters: { calculations, datasets, filterCombination, 6 more }` - `calculations: optional array of { operator, alias, key, keyType }` Create Calculations to compute as part of the query. - `operator: "uniq" or "count" or "max" or 35 more` - `"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 string` - `key: optional string` - `keyType: optional "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `datasets: optional array of string` Set the Datasets to query. Leave it empty to query all the datasets. - `filterCombination: optional "and" or "or" or "AND" or "OR"` Set a Flag to describe how to combine the filters on the query. - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: optional array of { filterCombination, filters, kind } or { key, operation, type, 2 more }` Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. - `{ filterCombination, filters, kind }` - `filterCombination: "and" or "or" or "AND" or "OR"` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: array of unknown` - `kind: "group"` - `"group"` - `WorkersObservabilityFilterLeaf { key, operation, type, 2 more }` 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: string` 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: "includes" or "not_includes" or "starts_with" or 25 more` - `"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: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `kind: optional "filter"` - `"filter"` - `value: optional string or number or boolean` 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. - `string` - `number` - `boolean` - `groupBys: optional array of { type, value }` Define how to group the results of the query. - `type: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `value: string` - `havings: optional array of { key, operation, value }` Configure the Having clauses that filter on calculations in the query result. - `key: string` - `operation: "eq" or "neq" or "gt" or 3 more` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `value: number` - `limit: optional number` Set a limit on the number of results / records returned by the query - `needle: optional { value, isRegex, matchCase }` Define an expression to search using full-text search. - `value:` - `isRegex: optional boolean` - `matchCase: optional boolean` - `orderBy: optional { value, order }` Configure the order of the results returned by the query. - `value: string` Configure which Calculation to order the results by. - `order: optional "asc" or "desc"` Set the order of the results - `"asc"` - `"desc"` - `updated: string` - `updatedBy: string` - `status: "STARTED" or "COMPLETED"` - `"STARTED"` - `"COMPLETED"` - `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` - `created: optional string` - `statistics: optional { bytes_read, elapsed, rows_read, abr_level }` - `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: optional number` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `updated: optional string` - `statistics: { bytes_read, elapsed, rows_read, abr_level }` The statistics object contains information about query performance from the database, it does not include any 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: optional number` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `agents: optional array of { agentClass, eventTypeCounts, firstEventMs, 5 more }` - `agentClass: string` - `eventTypeCounts: map[number]` - `firstEventMs: number` - `hasErrors: boolean` - `lastEventMs: number` - `namespace: string` - `service: string` - `totalEvents: number` - `calculations: optional array of { aggregates, calculation, series, alias }` - `aggregates: array of { count, interval, sampleInterval, 2 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `calculation: string` - `series: array of { data, time }` - `data: array of { count, interval, sampleInterval, 4 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `firstSeen: optional string` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `lastSeen: optional string` - `time: string` - `alias: optional string` - `compare: optional array of { aggregates, calculation, series, alias }` - `aggregates: array of { count, interval, sampleInterval, 2 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `calculation: string` - `series: array of { data, time }` - `data: array of { count, interval, sampleInterval, 4 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `firstSeen: optional string` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `lastSeen: optional string` - `time: string` - `alias: optional string` - `events: optional { count, events, fields, series }` - `count: optional number` - `events: optional array of { "$metadata", dataset, source, 3 more }` - `"$metadata": { id, account, cloudService, 28 more }` - `id: string` Unique event ID. Use as the cursor for offset-based pagination. - `account: optional string` - `cloudService: optional string` - `coldStart: optional number` - `cost: optional number` - `duration: optional number` - `endTime: optional number` - `error: optional string` - `errorTemplate: optional string` - `fingerprint: optional string` - `level: optional string` - `message: optional string` - `messageTemplate: optional string` - `metricName: optional string` - `origin: optional string` - `parentSpanId: optional string` - `provider: optional string` - `region: optional string` - `requestId: optional string` - `service: optional string` - `spanId: optional string` - `spanName: optional string` - `stackId: optional string` - `startTime: optional number` - `statusCode: optional number` - `traceDuration: optional number` - `traceId: optional string` - `transactionName: optional string` - `trigger: optional string` - `type: optional string` - `url: optional string` - `dataset: string` - `source: string or unknown` - `string` - `unknown` - `timestamp: number` - `"$containers": optional unknown` Cloudflare Containers event information enriches your logs so you can easily identify and debug issues. - `"$workers": optional { eventType, requestId, scriptName, 7 more } or { cpuTimeMs, eventType, outcome, 11 more }` Cloudflare Workers event information enriches your logs so you can easily identify and debug issues. - `{ eventType, requestId, scriptName, 7 more }` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `requestId: string` - `scriptName: string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `outcome: optional string` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `{ cpuTimeMs, eventType, outcome, 11 more }` - `cpuTimeMs: number` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: string` - `requestId: string` - `scriptName: string` - `wallTimeMs: number` - `diagnosticsChannelEvents: optional array of { channel, message, timestamp }` - `channel: string` - `message: string` - `timestamp: number` - `dispatchNamespace: optional string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `fields: optional array of { key, type }` - `key: string` - `type: string` - `series: optional array of { data, time }` - `data: array of { aggregates, count, interval, 3 more }` - `aggregates: { _count, _interval, _firstSeen, 2 more }` - `_count: number` - `_interval: number` - `_firstSeen: optional string` - `_lastSeen: optional string` - `bin: optional unknown` - `count: number` - `interval: number` - `sampleInterval: number` - `errors: optional number` - `groups: optional map[string or number or boolean]` Groups in the query results. - `string` - `number` - `boolean` - `time: string` - `invocations: optional map[array of { "$metadata", dataset, source, 3 more } ]` - `"$metadata": { id, account, cloudService, 28 more }` - `id: string` Unique event ID. Use as the cursor for offset-based pagination. - `account: optional string` - `cloudService: optional string` - `coldStart: optional number` - `cost: optional number` - `duration: optional number` - `endTime: optional number` - `error: optional string` - `errorTemplate: optional string` - `fingerprint: optional string` - `level: optional string` - `message: optional string` - `messageTemplate: optional string` - `metricName: optional string` - `origin: optional string` - `parentSpanId: optional string` - `provider: optional string` - `region: optional string` - `requestId: optional string` - `service: optional string` - `spanId: optional string` - `spanName: optional string` - `stackId: optional string` - `startTime: optional number` - `statusCode: optional number` - `traceDuration: optional number` - `traceId: optional string` - `transactionName: optional string` - `trigger: optional string` - `type: optional string` - `url: optional string` - `dataset: string` - `source: string or unknown` - `string` - `unknown` - `timestamp: number` - `"$containers": optional unknown` Cloudflare Containers event information enriches your logs so you can easily identify and debug issues. - `"$workers": optional { eventType, requestId, scriptName, 7 more } or { cpuTimeMs, eventType, outcome, 11 more }` Cloudflare Workers event information enriches your logs so you can easily identify and debug issues. - `{ eventType, requestId, scriptName, 7 more }` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `requestId: string` - `scriptName: string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `outcome: optional string` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `{ cpuTimeMs, eventType, outcome, 11 more }` - `cpuTimeMs: number` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: string` - `requestId: string` - `scriptName: string` - `wallTimeMs: number` - `diagnosticsChannelEvents: optional array of { channel, message, timestamp }` - `channel: string` - `message: string` - `timestamp: number` - `dispatchNamespace: optional string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `traces: optional array of { rootSpanName, rootTransactionName, service, 6 more }` - `rootSpanName: string` - `rootTransactionName: string` - `service: array of string` - `spans: number` - `traceDurationMs: number` - `traceEndMs: number` - `traceId: string` - `traceStartMs: number` - `errors: optional array of string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/observability/telemetry/query \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "queryId": "queryId", "timeframe": { "from": 0, "to": 0 } }' ``` #### Response ```json { "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 } ``` ## List values **post** `/accounts/{account_id}/workers/observability/telemetry/values` List unique values found in your events. ### Path Parameters - `account_id: string` ### Body Parameters - `datasets: array of string` Leave this empty to use the default datasets - `key: string` - `timeframe: { from, to }` - `from: number` - `to: number` - `type: "string" or "boolean" or "number"` - `"string"` - `"boolean"` - `"number"` - `filters: optional array of { filterCombination, filters, kind } or { key, operation, type, 2 more }` Apply filters before listing values. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. - `{ filterCombination, filters, kind }` - `filterCombination: "and" or "or" or "AND" or "OR"` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: array of unknown` - `kind: "group"` - `"group"` - `WorkersObservabilityFilterLeaf { key, operation, type, 2 more }` 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: string` 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: "includes" or "not_includes" or "starts_with" or 25 more` - `"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: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `kind: optional "filter"` - `"filter"` - `value: optional string or number or boolean` 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. - `string` - `number` - `boolean` - `limit: optional number` - `needle: optional { value, isRegex, matchCase }` Search for a specific substring in the event. - `value: string or number or boolean` - `string` - `number` - `boolean` - `isRegex: optional boolean` - `matchCase: optional boolean` ### Returns - `errors: array of { message }` - `message: string` - `messages: array of { message }` - `message: "Successful request"` - `"Successful request"` - `result: array of { dataset, key, type, value }` - `dataset: string` - `key: string` - `type: "string" or "boolean" or "number"` - `"string"` - `"boolean"` - `"number"` - `value: string or number or boolean` - `string` - `number` - `boolean` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/observability/telemetry/values \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "datasets": [ "string" ], "key": "key", "timeframe": { "from": 0, "to": 0 }, "type": "string" }' ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "Successful request" } ], "result": [ { "dataset": "dataset", "key": "key", "type": "string", "value": "string" } ], "success": true } ``` ## Domain Types ### Telemetry Keys Response - `TelemetryKeysResponse { key, lastSeenAt, type }` - `key: string` - `lastSeenAt: number` - `type: "string" or "boolean" or "number"` - `"string"` - `"boolean"` - `"number"` ### Telemetry Query Response - `TelemetryQueryResponse { run, statistics, agents, 5 more }` - `run: { id, accountId, dry, 8 more }` A Workers Observability Query Object - `id: string` - `accountId: string` - `dry: boolean` - `granularity: number` - `query: { id, adhoc, created, 6 more }` - `id: string` - `adhoc: boolean` If the query wasn't explcitly saved - `created: string` - `createdBy: string` - `description: string` - `name: string` Query name - `parameters: { calculations, datasets, filterCombination, 6 more }` - `calculations: optional array of { operator, alias, key, keyType }` Create Calculations to compute as part of the query. - `operator: "uniq" or "count" or "max" or 35 more` - `"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 string` - `key: optional string` - `keyType: optional "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `datasets: optional array of string` Set the Datasets to query. Leave it empty to query all the datasets. - `filterCombination: optional "and" or "or" or "AND" or "OR"` Set a Flag to describe how to combine the filters on the query. - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: optional array of { filterCombination, filters, kind } or { key, operation, type, 2 more }` Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. - `{ filterCombination, filters, kind }` - `filterCombination: "and" or "or" or "AND" or "OR"` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: array of unknown` - `kind: "group"` - `"group"` - `WorkersObservabilityFilterLeaf { key, operation, type, 2 more }` 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: string` 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: "includes" or "not_includes" or "starts_with" or 25 more` - `"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: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `kind: optional "filter"` - `"filter"` - `value: optional string or number or boolean` 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. - `string` - `number` - `boolean` - `groupBys: optional array of { type, value }` Define how to group the results of the query. - `type: "string" or "number" or "boolean"` - `"string"` - `"number"` - `"boolean"` - `value: string` - `havings: optional array of { key, operation, value }` Configure the Having clauses that filter on calculations in the query result. - `key: string` - `operation: "eq" or "neq" or "gt" or 3 more` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `value: number` - `limit: optional number` Set a limit on the number of results / records returned by the query - `needle: optional { value, isRegex, matchCase }` Define an expression to search using full-text search. - `value:` - `isRegex: optional boolean` - `matchCase: optional boolean` - `orderBy: optional { value, order }` Configure the order of the results returned by the query. - `value: string` Configure which Calculation to order the results by. - `order: optional "asc" or "desc"` Set the order of the results - `"asc"` - `"desc"` - `updated: string` - `updatedBy: string` - `status: "STARTED" or "COMPLETED"` - `"STARTED"` - `"COMPLETED"` - `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` - `created: optional string` - `statistics: optional { bytes_read, elapsed, rows_read, abr_level }` - `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: optional number` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `updated: optional string` - `statistics: { bytes_read, elapsed, rows_read, abr_level }` The statistics object contains information about query performance from the database, it does not include any 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: optional number` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `agents: optional array of { agentClass, eventTypeCounts, firstEventMs, 5 more }` - `agentClass: string` - `eventTypeCounts: map[number]` - `firstEventMs: number` - `hasErrors: boolean` - `lastEventMs: number` - `namespace: string` - `service: string` - `totalEvents: number` - `calculations: optional array of { aggregates, calculation, series, alias }` - `aggregates: array of { count, interval, sampleInterval, 2 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `calculation: string` - `series: array of { data, time }` - `data: array of { count, interval, sampleInterval, 4 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `firstSeen: optional string` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `lastSeen: optional string` - `time: string` - `alias: optional string` - `compare: optional array of { aggregates, calculation, series, alias }` - `aggregates: array of { count, interval, sampleInterval, 2 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `calculation: string` - `series: array of { data, time }` - `data: array of { count, interval, sampleInterval, 4 more }` - `count: number` - `interval: number` - `sampleInterval: number` - `value: number` - `firstSeen: optional string` - `groups: optional array of { key, value }` - `key: string` - `value: string or number or boolean` - `string` - `number` - `boolean` - `lastSeen: optional string` - `time: string` - `alias: optional string` - `events: optional { count, events, fields, series }` - `count: optional number` - `events: optional array of { "$metadata", dataset, source, 3 more }` - `"$metadata": { id, account, cloudService, 28 more }` - `id: string` Unique event ID. Use as the cursor for offset-based pagination. - `account: optional string` - `cloudService: optional string` - `coldStart: optional number` - `cost: optional number` - `duration: optional number` - `endTime: optional number` - `error: optional string` - `errorTemplate: optional string` - `fingerprint: optional string` - `level: optional string` - `message: optional string` - `messageTemplate: optional string` - `metricName: optional string` - `origin: optional string` - `parentSpanId: optional string` - `provider: optional string` - `region: optional string` - `requestId: optional string` - `service: optional string` - `spanId: optional string` - `spanName: optional string` - `stackId: optional string` - `startTime: optional number` - `statusCode: optional number` - `traceDuration: optional number` - `traceId: optional string` - `transactionName: optional string` - `trigger: optional string` - `type: optional string` - `url: optional string` - `dataset: string` - `source: string or unknown` - `string` - `unknown` - `timestamp: number` - `"$containers": optional unknown` Cloudflare Containers event information enriches your logs so you can easily identify and debug issues. - `"$workers": optional { eventType, requestId, scriptName, 7 more } or { cpuTimeMs, eventType, outcome, 11 more }` Cloudflare Workers event information enriches your logs so you can easily identify and debug issues. - `{ eventType, requestId, scriptName, 7 more }` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `requestId: string` - `scriptName: string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `outcome: optional string` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `{ cpuTimeMs, eventType, outcome, 11 more }` - `cpuTimeMs: number` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: string` - `requestId: string` - `scriptName: string` - `wallTimeMs: number` - `diagnosticsChannelEvents: optional array of { channel, message, timestamp }` - `channel: string` - `message: string` - `timestamp: number` - `dispatchNamespace: optional string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `fields: optional array of { key, type }` - `key: string` - `type: string` - `series: optional array of { data, time }` - `data: array of { aggregates, count, interval, 3 more }` - `aggregates: { _count, _interval, _firstSeen, 2 more }` - `_count: number` - `_interval: number` - `_firstSeen: optional string` - `_lastSeen: optional string` - `bin: optional unknown` - `count: number` - `interval: number` - `sampleInterval: number` - `errors: optional number` - `groups: optional map[string or number or boolean]` Groups in the query results. - `string` - `number` - `boolean` - `time: string` - `invocations: optional map[array of { "$metadata", dataset, source, 3 more } ]` - `"$metadata": { id, account, cloudService, 28 more }` - `id: string` Unique event ID. Use as the cursor for offset-based pagination. - `account: optional string` - `cloudService: optional string` - `coldStart: optional number` - `cost: optional number` - `duration: optional number` - `endTime: optional number` - `error: optional string` - `errorTemplate: optional string` - `fingerprint: optional string` - `level: optional string` - `message: optional string` - `messageTemplate: optional string` - `metricName: optional string` - `origin: optional string` - `parentSpanId: optional string` - `provider: optional string` - `region: optional string` - `requestId: optional string` - `service: optional string` - `spanId: optional string` - `spanName: optional string` - `stackId: optional string` - `startTime: optional number` - `statusCode: optional number` - `traceDuration: optional number` - `traceId: optional string` - `transactionName: optional string` - `trigger: optional string` - `type: optional string` - `url: optional string` - `dataset: string` - `source: string or unknown` - `string` - `unknown` - `timestamp: number` - `"$containers": optional unknown` Cloudflare Containers event information enriches your logs so you can easily identify and debug issues. - `"$workers": optional { eventType, requestId, scriptName, 7 more } or { cpuTimeMs, eventType, outcome, 11 more }` Cloudflare Workers event information enriches your logs so you can easily identify and debug issues. - `{ eventType, requestId, scriptName, 7 more }` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `requestId: string` - `scriptName: string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `outcome: optional string` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `{ cpuTimeMs, eventType, outcome, 11 more }` - `cpuTimeMs: number` - `eventType: "fetch" or "scheduled" or "alarm" or 8 more` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: string` - `requestId: string` - `scriptName: string` - `wallTimeMs: number` - `diagnosticsChannelEvents: optional array of { channel, message, timestamp }` - `channel: string` - `message: string` - `timestamp: number` - `dispatchNamespace: optional string` - `durableObjectId: optional string` - `entrypoint: optional string` - `event: optional map[unknown]` - `executionModel: optional "durableObject" or "stateless"` - `"durableObject"` - `"stateless"` - `scriptVersion: optional { id, message, tag }` - `id: optional string` - `message: optional string` - `tag: optional string` - `truncated: optional boolean` - `traces: optional array of { rootSpanName, rootTransactionName, service, 6 more }` - `rootSpanName: string` - `rootTransactionName: string` - `service: array of string` - `spans: number` - `traceDurationMs: number` - `traceEndMs: number` - `traceId: string` - `traceStartMs: number` - `errors: optional array of string` ### Telemetry Values Response - `TelemetryValuesResponse { dataset, key, type, value }` - `dataset: string` - `key: string` - `type: "string" or "boolean" or "number"` - `"string"` - `"boolean"` - `"number"` - `value: string or number or boolean` - `string` - `number` - `boolean` # Destinations ## Get Destinations **get** `/accounts/{account_id}/workers/observability/destinations` List your Workers Observability Telemetry Destinations. ### Path Parameters - `account_id: string` ### Query Parameters - `order: optional "asc" or "desc"` - `"asc"` - `"desc"` - `orderBy: optional "created" or "updated"` - `"created"` - `"updated"` - `page: optional number` - `perPage: optional number` ### Returns - `errors: array of { message }` - `message: string` - `messages: array of { message }` - `message: "Successful request"` - `"Successful request"` - `result: array of { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, headers, jobStatus, 3 more }` - `destination_conf: string` - `headers: map[string]` - `jobStatus: { error_message, last_complete, last_error }` - `error_message: string` - `last_complete: string` - `last_error: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/observability/destinations \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "Successful request" } ], "result": [ { "configuration": { "destination_conf": "destination_conf", "headers": { "foo": "string" }, "jobStatus": { "error_message": "error_message", "last_complete": "last_complete", "last_error": "last_error" }, "logpushDataset": "opentelemetry-traces", "type": "logpush", "url": "url" }, "enabled": true, "name": "name", "scripts": [ "string" ], "slug": "slug" } ], "success": true } ``` ## Create Destination **post** `/accounts/{account_id}/workers/observability/destinations` Create a new Workers Observability Telemetry Destination. ### Path Parameters - `account_id: string` ### Body Parameters - `configuration: { headers, logpushDataset, type, url }` - `headers: map[string]` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `skipPreflightCheck: optional boolean` ### Returns - `errors: array of { message }` - `message: string` - `messages: array of { message }` - `message: "Resource created"` - `"Resource created"` - `result: { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, logpushDataset, logpushJob, 2 more }` - `destination_conf: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpushJob: number` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/observability/destinations \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "configuration": { "headers": { "foo": "string" }, "logpushDataset": "opentelemetry-traces", "type": "logpush", "url": "url" }, "enabled": true, "name": "name" }' ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "Resource created" } ], "result": { "configuration": { "destination_conf": "destination_conf", "logpushDataset": "opentelemetry-traces", "logpushJob": 0, "type": "logpush", "url": "url" }, "enabled": true, "name": "name", "scripts": [ "string" ], "slug": "slug" }, "success": true } ``` ## Update Destination **patch** `/accounts/{account_id}/workers/observability/destinations/{slug}` Update an existing Workers Observability Telemetry Destination. ### Path Parameters - `account_id: string` - `slug: string` ### Body Parameters - `configuration: { headers, type, url }` - `headers: map[string]` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` ### Returns - `errors: array of { message }` - `message: string` - `messages: array of { message }` - `message: "Successful request"` - `"Successful request"` - `result: { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, logpushDataset, logpushJob, 2 more }` - `destination_conf: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpushJob: number` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/observability/destinations/$SLUG \ -X PATCH \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "configuration": { "headers": { "foo": "string" }, "type": "logpush", "url": "url" }, "enabled": true }' ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "Successful request" } ], "result": { "configuration": { "destination_conf": "destination_conf", "logpushDataset": "opentelemetry-traces", "logpushJob": 0, "type": "logpush", "url": "url" }, "enabled": true, "name": "name", "scripts": [ "string" ], "slug": "slug" }, "success": true } ``` ## Delete Destination **delete** `/accounts/{account_id}/workers/observability/destinations/{slug}` Delete a Workers Observability Telemetry Destination. ### Path Parameters - `account_id: string` - `slug: string` ### Returns - `errors: array of { message }` - `message: string` - `messages: array of { message }` - `message: "Successful request"` - `"Successful request"` - `success: true` - `true` - `result: optional { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, logpushDataset, logpushJob, 2 more }` - `destination_conf: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpushJob: number` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/observability/destinations/$SLUG \ -X DELETE \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "Successful request" } ], "success": true, "result": { "configuration": { "destination_conf": "destination_conf", "logpushDataset": "opentelemetry-traces", "logpushJob": 0, "type": "logpush", "url": "url" }, "enabled": true, "name": "name", "scripts": [ "string" ], "slug": "slug" } } ``` ## Domain Types ### Destination List Response - `DestinationListResponse { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, headers, jobStatus, 3 more }` - `destination_conf: string` - `headers: map[string]` - `jobStatus: { error_message, last_complete, last_error }` - `error_message: string` - `last_complete: string` - `last_error: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string` ### Destination Create Response - `DestinationCreateResponse { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, logpushDataset, logpushJob, 2 more }` - `destination_conf: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpushJob: number` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string` ### Destination Update Response - `DestinationUpdateResponse { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, logpushDataset, logpushJob, 2 more }` - `destination_conf: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpushJob: number` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string` ### Destination Delete Response - `DestinationDeleteResponse { configuration, enabled, name, 2 more }` - `configuration: { destination_conf, logpushDataset, logpushJob, 2 more }` - `destination_conf: string` - `logpushDataset: "opentelemetry-traces" or "opentelemetry-logs"` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpushJob: number` - `type: "logpush"` - `"logpush"` - `url: string` - `enabled: boolean` - `name: string` - `scripts: array of string` - `slug: string`