# Observability # Telemetry ## List keys `workers.observability.telemetry.keys(TelemetryKeysParams**kwargs) -> SyncSinglePage[TelemetryKeysResponse]` **post** `/accounts/{account_id}/workers/observability/telemetry/keys` List all the keys in your telemetry events. ### Parameters - `account_id: str` - `datasets: Optional[Sequence[str]]` Leave this empty to use the default datasets - `filters: Optional[Iterable[Filter]]` Apply filters to narrow key discovery. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. - `class FilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Iterable[FilterUnionMember0Filter]` - `class FilterUnionMember0FilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Iterable[object]` - `kind: Literal["group"]` - `"group"` - `class FilterUnionMember0FilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool]]` 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). - `str` - `float` - `bool` - `kind: Literal["group"]` - `"group"` - `class FilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool]]` 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). - `str` - `float` - `bool` - `from_: Optional[float]` - `key_needle: Optional[KeyNeedle]` 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: Union[str, float, bool]` The text or pattern to search for. - `str` - `float` - `bool` - `is_regex: Optional[bool]` When true, treats the value as a regular expression (RE2 syntax). - `match_case: Optional[bool]` When true, performs a case-sensitive search. Defaults to case-insensitive. - `limit: Optional[float]` Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering. - `needle: Optional[Needle]` Search for a specific substring in any of the events - `value: Union[str, float, bool]` The text or pattern to search for. - `str` - `float` - `bool` - `is_regex: Optional[bool]` When true, treats the value as a regular expression (RE2 syntax). - `match_case: Optional[bool]` When true, performs a case-sensitive search. Defaults to case-insensitive. - `to: Optional[float]` ### Returns - `class TelemetryKeysResponse: …` - `key: str` - `last_seen_at: float` - `type: Literal["string", "boolean", "number"]` - `"string"` - `"boolean"` - `"number"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) page = client.workers.observability.telemetry.keys( account_id="account_id", ) page = page.result[0] print(page.key) ``` #### Response ```json { "errors": [ { "message": "message" } ], "messages": [ { "message": "Successful request" } ], "result": [ { "key": "key", "lastSeenAt": 0, "type": "string" } ], "success": true } ``` ## Run a query `workers.observability.telemetry.query(TelemetryQueryParams**kwargs) -> TelemetryQueryResponse` **post** `/accounts/{account_id}/workers/observability/telemetry/query` Run a temporary or saved query. ### Parameters - `account_id: str` - `query_id: str` Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID). - `timeframe: Timeframe` Timeframe for the query using Unix timestamps in milliseconds. Narrower timeframes produce faster responses and more specific results. - `from_: float` Start timestamp for the query timeframe (Unix timestamp in milliseconds) - `to: float` End timestamp for the query timeframe (Unix timestamp in milliseconds) - `chart: Optional[bool]` When true, includes time-series data in the response. - `compare: Optional[bool]` When true, includes a comparison dataset from the previous time period of equal length. - `dry: Optional[bool]` When true, executes the query without persisting the results. Useful for validation or previewing. - `granularity: Optional[float]` Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity. - `ignore_series: Optional[bool]` When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed. - `limit: Optional[float]` Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'. - `offset: Optional[str]` Cursor for pagination in event, trace, and invocation views. Pass the $metadata.id of the last returned item to fetch the next page. - `offset_by: Optional[float]` Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination. - `offset_direction: Optional[str]` Pagination direction: 'next' for forward, 'prev' for backward. - `parameters: Optional[Parameters]` Query parameters defining what data to retrieve — filters, calculations, group-bys, and ordering. In practice this should always be provided for ad-hoc queries. Only omit when executing a previously saved query by queryId. Use the keys and values endpoints to discover available fields before building filters. - `calculations: Optional[Iterable[ParametersCalculation]]` Aggregation calculations to compute (e.g. count, avg, p99). Each calculation produces aggregate values and optional time-series data. - `operator: Literal["uniq", "count", "max", 35 more]` Aggregation operator to apply. Examples: count, avg, sum, min, max, p50, p90, p95, p99, uniq, stddev, variance. - `"uniq"` - `"count"` - `"max"` - `"min"` - `"sum"` - `"avg"` - `"median"` - `"p001"` - `"p01"` - `"p05"` - `"p10"` - `"p25"` - `"p75"` - `"p90"` - `"p95"` - `"p99"` - `"p999"` - `"stddev"` - `"variance"` - `"COUNT_DISTINCT"` - `"COUNT"` - `"MAX"` - `"MIN"` - `"SUM"` - `"AVG"` - `"MEDIAN"` - `"P001"` - `"P01"` - `"P05"` - `"P10"` - `"P25"` - `"P75"` - `"P90"` - `"P95"` - `"P99"` - `"P999"` - `"STDDEV"` - `"VARIANCE"` - `alias: Optional[str]` Custom label for this calculation in the results. Useful for distinguishing multiple calculations. - `key: Optional[str]` Field name to calculate over. Must exist in the data — verify with the keys endpoint. Omit for operators that don't require a key (e.g. count). - `key_type: Optional[Literal["string", "number", "boolean"]]` Data type of the key. Required when key is provided to ensure correct aggregation. - `"string"` - `"number"` - `"boolean"` - `datasets: Optional[Sequence[str]]` Datasets to query. Leave empty to query all available datasets. - `filter_combination: Optional[Literal["and", "or", "AND", "OR"]]` Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'. - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Optional[Iterable[ParametersFilter]]` Filters to narrow query results. Use the keys and values endpoints to discover available fields before building filters. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. - `class ParametersFilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Iterable[ParametersFilterUnionMember0Filter]` - `class ParametersFilterUnionMember0FilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Iterable[object]` - `kind: Literal["group"]` - `"group"` - `class ParametersFilterUnionMember0FilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool]]` 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). - `str` - `float` - `bool` - `kind: Literal["group"]` - `"group"` - `class ParametersFilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool]]` 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). - `str` - `float` - `bool` - `group_bys: Optional[Iterable[ParametersGroupBy]]` Fields to group calculation results by. Only applicable when the query view is 'calculations'. Produces per-group aggregate values. - `type: Literal["string", "number", "boolean"]` Data type of the group-by field. - `"string"` - `"number"` - `"boolean"` - `value: str` Field name to group results by (e.g. $metadata.service, $metadata.statusCode). - `havings: Optional[Iterable[ParametersHaving]]` Post-aggregation filters applied to calculation results. Use to filter groups after aggregation (e.g. only groups where count > 100). - `key: str` Calculation alias or operator to filter on after aggregation. - `operation: Literal["eq", "neq", "gt", 3 more]` Numeric comparison operator: eq, neq, gt, gte, lt, lte. - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `value: float` Threshold value to compare the calculation result against. - `limit: Optional[int]` Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases. - `needle: Optional[ParametersNeedle]` Full-text search expression applied across all event fields. Matches events containing the specified text. - `value: Union[str, float, bool]` The text or pattern to search for. - `str` - `float` - `bool` - `is_regex: Optional[bool]` When true, treats the value as a regular expression (RE2 syntax). - `match_case: Optional[bool]` When true, performs a case-sensitive search. Defaults to case-insensitive. - `order_by: Optional[ParametersOrderBy]` Ordering for grouped calculation results. Only effective when a group-by is present. - `value: str` Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query. - `order: Optional[Literal["asc", "desc"]]` Sort direction: 'asc' for ascending, 'desc' for descending. - `"asc"` - `"desc"` - `view: Optional[Literal["traces", "events", "calculations", 3 more]]` Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': Durable Object agent summaries. - `"traces"` - `"events"` - `"calculations"` - `"invocations"` - `"requests"` - `"agents"` ### Returns - `class TelemetryQueryResponse: …` Complete results of a query run. The populated fields depend on the requested view type (events, calculations, invocations, traces, or agents). - `run: Run` The query run metadata including the query definition, execution status, and timeframe. - `id: str` Unique identifier for this query run. - `account_id: str` Cloudflare account ID that owns this query run. - `dry: bool` Whether this was a dry run (results not persisted). - `granularity: float` Number of time-series buckets used for the query. Higher values produce more detailed series data. - `query: RunQuery` A saved query definition with its parameters, metadata, and ownership information. - `id: str` - `adhoc: bool` If the query wasn't explcitly saved - `created: str` - `created_by: str` - `description: Optional[str]` - `name: str` Query name - `parameters: RunQueryParameters` - `calculations: Optional[List[RunQueryParametersCalculation]]` Create Calculations to compute as part of the query. - `operator: Literal["uniq", "count", "max", 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[str]` - `key: Optional[str]` - `key_type: Optional[Literal["string", "number", "boolean"]]` - `"string"` - `"number"` - `"boolean"` - `datasets: Optional[List[str]]` Set the Datasets to query. Leave it empty to query all the datasets. - `filter_combination: Optional[Literal["and", "or", "AND", "OR"]]` Set a Flag to describe how to combine the filters on the query. - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Optional[List[RunQueryParametersFilter]]` Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. - `class RunQueryParametersFilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: List[object]` - `kind: Literal["group"]` - `"group"` - `class RunQueryParametersFilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool, null]]` 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). - `str` - `float` - `bool` - `group_bys: Optional[List[RunQueryParametersGroupBy]]` Define how to group the results of the query. - `type: Literal["string", "number", "boolean"]` - `"string"` - `"number"` - `"boolean"` - `value: str` - `havings: Optional[List[RunQueryParametersHaving]]` Configure the Having clauses that filter on calculations in the query result. - `key: str` - `operation: Literal["eq", "neq", "gt", 3 more]` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `value: float` - `limit: Optional[int]` Set a limit on the number of results / records returned by the query - `needle: Optional[RunQueryParametersNeedle]` Define an expression to search using full-text search. - `value: RunQueryParametersNeedleValue` - `is_regex: Optional[bool]` - `match_case: Optional[bool]` - `order_by: Optional[RunQueryParametersOrderBy]` Configure the order of the results returned by the query. - `value: str` Configure which Calculation to order the results by. - `order: Optional[Literal["asc", "desc"]]` Set the order of the results - `"asc"` - `"desc"` - `updated: str` - `updated_by: str` - `status: Literal["STARTED", "COMPLETED"]` Current execution status of the query run. - `"STARTED"` - `"COMPLETED"` - `timeframe: RunTimeframe` Time range for the query execution - `from_: float` Start timestamp for the query timeframe (Unix timestamp in milliseconds) - `to: float` End timestamp for the query timeframe (Unix timestamp in milliseconds) - `user_id: str` ID of the user who initiated the query run. - `created: Optional[str]` ISO-8601 timestamp when the query run was created. - `statistics: Optional[RunStatistics]` Query performance statistics from the database (does not include network latency). - `bytes_read: float` Number of uncompressed bytes read from the table. - `elapsed: float` Time in seconds for the query to run. - `rows_read: float` Number of rows scanned from the table. - `abr_level: Optional[float]` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `updated: Optional[str]` ISO-8601 timestamp when the query run was last updated. - `statistics: Statistics` Query performance statistics from the database. Includes execution time, rows scanned, and bytes read. Does not include network latency. - `bytes_read: float` Number of uncompressed bytes read from the table. - `elapsed: float` Time in seconds for the query to run. - `rows_read: float` Number of rows scanned from the table. - `abr_level: Optional[float]` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `agents: Optional[List[Agent]]` Durable Object agent summaries. Present when the query view is 'agents'. Each entry represents an agent with its event counts and status. - `agent_class: str` Class name of the Durable Object agent. - `event_type_counts: Dict[str, float]` Breakdown of event counts by event type. - `first_event_ms: float` Timestamp of the earliest event from this agent in the queried window (Unix epoch ms). - `has_errors: bool` Whether the agent emitted any error events in the queried window. - `last_event_ms: float` Timestamp of the most recent event from this agent (Unix epoch ms). - `namespace: str` Durable Object namespace the agent belongs to. - `service: str` Worker service name that hosts this agent. - `total_events: float` Total number of events emitted by this agent in the queried window. - `calculations: Optional[List[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: List[CalculationAggregate]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `groups: Optional[List[CalculationAggregateGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `calculation: str` - `series: List[CalculationSeries]` - `data: List[CalculationSeriesData]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `first_seen: Optional[str]` - `groups: Optional[List[CalculationSeriesDataGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `last_seen: Optional[str]` - `time: str` - `alias: Optional[str]` - `compare: Optional[List[Compare]]` Comparison calculation results from the previous time period. Present when the compare option is enabled. Same structure as calculations. - `aggregates: List[CompareAggregate]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `groups: Optional[List[CompareAggregateGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `calculation: str` - `series: List[CompareSeries]` - `data: List[CompareSeriesData]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `first_seen: Optional[str]` - `groups: Optional[List[CompareSeriesDataGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `last_seen: Optional[str]` - `time: str` - `alias: Optional[str]` - `events: Optional[Events]` Individual event results. Present when the query view is 'events'. Contains the matching log lines and their metadata. - `count: Optional[float]` Total number of events matching the query (may exceed the number returned due to limits). - `events: Optional[List[EventsEvent]]` List of individual telemetry events matching the query. - `metadata: EventsEventMetadata` Structured metadata extracted from the event. These fields are indexed and available for filtering and aggregation. - `id: str` Unique event ID. Use as the cursor value for offset-based pagination. - `account: Optional[str]` Cloudflare account identifier. - `cloud_service: Optional[str]` Cloudflare product that generated this event (e.g. workers, pages). - `cold_start: Optional[int]` Whether this was a cold start (1) or warm invocation (0). - `cost: Optional[int]` Estimated cost units for this invocation. - `duration: Optional[int]` Span duration in milliseconds. - `end_time: Optional[int]` Span end time as a Unix epoch in milliseconds. - `error: Optional[str]` Error message, present when the log represents an error. - `error_template: Optional[str]` Templatized version of the error message used for grouping similar errors. - `fingerprint: Optional[str]` Content-based fingerprint used to group similar events. - `level: Optional[str]` Log level (e.g. log, debug, info, warn, error). - `message: Optional[str]` Log message text. - `message_template: Optional[str]` Templatized version of the log message used for grouping similar messages. - `metric_name: Optional[str]` Metric name when the event represents a metric data point. - `origin: Optional[str]` Origin of the event (e.g. fetch, scheduled, queue). - `parent_span_id: Optional[str]` Span ID of the parent span in the trace hierarchy. - `provider: Optional[str]` Infrastructure provider identifier. - `region: Optional[str]` Cloudflare data center / region that handled the request. - `request_id: Optional[str]` Cloudflare request ID that ties all logs from a single invocation together. - `service: Optional[str]` Worker script name that produced this event. - `span_id: Optional[str]` Span ID for this individual unit of work within a trace. - `span_name: Optional[str]` Human-readable name for this span. - `stack_id: Optional[str]` Stack / deployment identifier. - `start_time: Optional[int]` Span start time as a Unix epoch in milliseconds. - `status_code: Optional[int]` HTTP response status code returned by the Worker. - `trace_duration: Optional[int]` Total duration of the entire trace in milliseconds. - `trace_id: Optional[str]` Distributed trace ID linking spans across services. - `transaction_name: Optional[str]` Logical transaction name for this request. - `trigger: Optional[str]` What triggered the invocation (e.g. GET /users, POST /orders, queue message). - `type: Optional[str]` Event type classifier (e.g. cf-worker-event, cf-worker-log). - `url: Optional[str]` Request URL that triggered the Worker invocation. - `dataset: str` The dataset this event belongs to (e.g. cloudflare-workers). - `source: Union[str, object]` Raw log payload. May be a string or a structured object depending on how the log was emitted. - `str` - `object` - `timestamp: int` Event timestamp as a Unix epoch in milliseconds. - `containers: Optional[object]` Cloudflare Containers event information that enriches your logs for identifying and debugging issues. - `workers: Optional[EventsEventWorkers]` Cloudflare Workers event information that enriches your logs for identifying and debugging issues. - `class EventsEventWorkersUnionMember0: …` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `request_id: str` - `script_name: str` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `outcome: Optional[str]` - `script_version: Optional[EventsEventWorkersUnionMember0ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `class EventsEventWorkersUnionMember1: …` - `cpu_time_ms: float` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: str` - `request_id: str` - `script_name: str` - `wall_time_ms: float` - `diagnostics_channel_events: Optional[List[EventsEventWorkersUnionMember1DiagnosticsChannelEvent]]` - `channel: str` - `message: str` - `timestamp: float` - `dispatch_namespace: Optional[str]` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `script_version: Optional[EventsEventWorkersUnionMember1ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `fields: Optional[List[EventsField]]` List of fields discovered in the matched events. Useful for building dynamic UIs. - `key: str` Field name present in the matched events. - `type: str` Data type of the field (string, number, or boolean). - `series: Optional[List[EventsSeries]]` Time-series data for the matched events, bucketed by the query granularity. - `data: List[EventsSeriesData]` - `aggregates: EventsSeriesDataAggregates` - `_count: int` - `_interval: float` - `_first_seen: Optional[str]` - `_last_seen: Optional[str]` - `bin: Optional[object]` - `count: float` - `interval: float` - `sample_interval: float` - `errors: Optional[float]` - `groups: Optional[Dict[str, Union[str, float, bool]]]` Groups in the query results. - `str` - `float` - `bool` - `time: str` - `invocations: Optional[Dict[str, List[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: InvocationMetadata` Structured metadata extracted from the event. These fields are indexed and available for filtering and aggregation. - `id: str` Unique event ID. Use as the cursor value for offset-based pagination. - `account: Optional[str]` Cloudflare account identifier. - `cloud_service: Optional[str]` Cloudflare product that generated this event (e.g. workers, pages). - `cold_start: Optional[int]` Whether this was a cold start (1) or warm invocation (0). - `cost: Optional[int]` Estimated cost units for this invocation. - `duration: Optional[int]` Span duration in milliseconds. - `end_time: Optional[int]` Span end time as a Unix epoch in milliseconds. - `error: Optional[str]` Error message, present when the log represents an error. - `error_template: Optional[str]` Templatized version of the error message used for grouping similar errors. - `fingerprint: Optional[str]` Content-based fingerprint used to group similar events. - `level: Optional[str]` Log level (e.g. log, debug, info, warn, error). - `message: Optional[str]` Log message text. - `message_template: Optional[str]` Templatized version of the log message used for grouping similar messages. - `metric_name: Optional[str]` Metric name when the event represents a metric data point. - `origin: Optional[str]` Origin of the event (e.g. fetch, scheduled, queue). - `parent_span_id: Optional[str]` Span ID of the parent span in the trace hierarchy. - `provider: Optional[str]` Infrastructure provider identifier. - `region: Optional[str]` Cloudflare data center / region that handled the request. - `request_id: Optional[str]` Cloudflare request ID that ties all logs from a single invocation together. - `service: Optional[str]` Worker script name that produced this event. - `span_id: Optional[str]` Span ID for this individual unit of work within a trace. - `span_name: Optional[str]` Human-readable name for this span. - `stack_id: Optional[str]` Stack / deployment identifier. - `start_time: Optional[int]` Span start time as a Unix epoch in milliseconds. - `status_code: Optional[int]` HTTP response status code returned by the Worker. - `trace_duration: Optional[int]` Total duration of the entire trace in milliseconds. - `trace_id: Optional[str]` Distributed trace ID linking spans across services. - `transaction_name: Optional[str]` Logical transaction name for this request. - `trigger: Optional[str]` What triggered the invocation (e.g. GET /users, POST /orders, queue message). - `type: Optional[str]` Event type classifier (e.g. cf-worker-event, cf-worker-log). - `url: Optional[str]` Request URL that triggered the Worker invocation. - `dataset: str` The dataset this event belongs to (e.g. cloudflare-workers). - `source: Union[str, object]` Raw log payload. May be a string or a structured object depending on how the log was emitted. - `str` - `object` - `timestamp: int` Event timestamp as a Unix epoch in milliseconds. - `containers: Optional[object]` Cloudflare Containers event information that enriches your logs for identifying and debugging issues. - `workers: Optional[InvocationWorkers]` Cloudflare Workers event information that enriches your logs for identifying and debugging issues. - `class InvocationWorkersUnionMember0: …` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `request_id: str` - `script_name: str` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `outcome: Optional[str]` - `script_version: Optional[InvocationWorkersUnionMember0ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `class InvocationWorkersUnionMember1: …` - `cpu_time_ms: float` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: str` - `request_id: str` - `script_name: str` - `wall_time_ms: float` - `diagnostics_channel_events: Optional[List[InvocationWorkersUnionMember1DiagnosticsChannelEvent]]` - `channel: str` - `message: str` - `timestamp: float` - `dispatch_namespace: Optional[str]` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `script_version: Optional[InvocationWorkersUnionMember1ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `traces: Optional[List[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. - `root_span_name: str` Name of the root span that initiated the trace. - `root_transaction_name: str` Logical transaction name for the root span. - `service: List[str]` List of Worker services involved in the trace. - `spans: float` Total number of spans in the trace. - `trace_duration_ms: float` Total duration of the trace in milliseconds. - `trace_end_ms: float` Trace end time as a Unix epoch in milliseconds. - `trace_id: str` Unique identifier for the distributed trace. - `trace_start_ms: float` Trace start time as a Unix epoch in milliseconds. - `errors: Optional[List[str]]` Error messages encountered during the trace, if any. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) response = client.workers.observability.telemetry.query( account_id="account_id", query_id="queryId", timeframe={ "from": 0, "to": 0, }, ) print(response.run) ``` #### 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" }, "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", "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" }, "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 } ``` ## List values `workers.observability.telemetry.values(TelemetryValuesParams**kwargs) -> SyncSinglePage[TelemetryValuesResponse]` **post** `/accounts/{account_id}/workers/observability/telemetry/values` List unique values found in your events. ### Parameters - `account_id: str` - `datasets: Sequence[str]` Leave this empty to use the default datasets - `key: str` - `timeframe: Timeframe` - `from_: float` - `to: float` - `type: Literal["string", "boolean", "number"]` - `"string"` - `"boolean"` - `"number"` - `filters: Optional[Iterable[Filter]]` Apply filters before listing values. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. - `class FilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Iterable[FilterUnionMember0Filter]` - `class FilterUnionMember0FilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Iterable[object]` - `kind: Literal["group"]` - `"group"` - `class FilterUnionMember0FilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool]]` 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). - `str` - `float` - `bool` - `kind: Literal["group"]` - `"group"` - `class FilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool]]` 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). - `str` - `float` - `bool` - `limit: Optional[float]` - `needle: Optional[Needle]` Full-text search expression to match events containing the specified text or pattern. - `value: Union[str, float, bool]` The text or pattern to search for. - `str` - `float` - `bool` - `is_regex: Optional[bool]` When true, treats the value as a regular expression (RE2 syntax). - `match_case: Optional[bool]` When true, performs a case-sensitive search. Defaults to case-insensitive. ### Returns - `class TelemetryValuesResponse: …` - `dataset: str` - `key: str` - `type: Literal["string", "boolean", "number"]` - `"string"` - `"boolean"` - `"number"` - `value: Union[str, float, bool]` - `str` - `float` - `bool` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) page = client.workers.observability.telemetry.values( account_id="account_id", datasets=["string"], key="key", timeframe={ "from": 0, "to": 0, }, type="string", ) page = page.result[0] print(page.dataset) ``` #### 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 - `class TelemetryKeysResponse: …` - `key: str` - `last_seen_at: float` - `type: Literal["string", "boolean", "number"]` - `"string"` - `"boolean"` - `"number"` ### Telemetry Query Response - `class TelemetryQueryResponse: …` Complete results of a query run. The populated fields depend on the requested view type (events, calculations, invocations, traces, or agents). - `run: Run` The query run metadata including the query definition, execution status, and timeframe. - `id: str` Unique identifier for this query run. - `account_id: str` Cloudflare account ID that owns this query run. - `dry: bool` Whether this was a dry run (results not persisted). - `granularity: float` Number of time-series buckets used for the query. Higher values produce more detailed series data. - `query: RunQuery` A saved query definition with its parameters, metadata, and ownership information. - `id: str` - `adhoc: bool` If the query wasn't explcitly saved - `created: str` - `created_by: str` - `description: Optional[str]` - `name: str` Query name - `parameters: RunQueryParameters` - `calculations: Optional[List[RunQueryParametersCalculation]]` Create Calculations to compute as part of the query. - `operator: Literal["uniq", "count", "max", 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[str]` - `key: Optional[str]` - `key_type: Optional[Literal["string", "number", "boolean"]]` - `"string"` - `"number"` - `"boolean"` - `datasets: Optional[List[str]]` Set the Datasets to query. Leave it empty to query all the datasets. - `filter_combination: Optional[Literal["and", "or", "AND", "OR"]]` Set a Flag to describe how to combine the filters on the query. - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: Optional[List[RunQueryParametersFilter]]` Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. - `class RunQueryParametersFilterUnionMember0: …` - `filter_combination: Literal["and", "or", "AND", "OR"]` - `"and"` - `"or"` - `"AND"` - `"OR"` - `filters: List[object]` - `kind: Literal["group"]` - `"group"` - `class RunQueryParametersFilterWorkersObservabilityFilterLeaf: …` A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters. - `key: str` 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: Literal["includes", "not_includes", "starts_with", 25 more]` Comparison operator. String operators: includes, not_includes, starts_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. - `"includes"` - `"not_includes"` - `"starts_with"` - `"regex"` - `"exists"` - `"is_null"` - `"in"` - `"not_in"` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `"="` - `"!="` - `">"` - `">="` - `"<"` - `"<="` - `"INCLUDES"` - `"DOES_NOT_INCLUDE"` - `"MATCH_REGEX"` - `"EXISTS"` - `"DOES_NOT_EXIST"` - `"IN"` - `"NOT_IN"` - `"STARTS_WITH"` - `type: Literal["string", "number", "boolean"]` Data type of the filter field. Must match the actual type of the key being filtered. - `"string"` - `"number"` - `"boolean"` - `kind: Optional[Literal["filter"]]` Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted. - `"filter"` - `value: Optional[Union[str, float, bool, null]]` 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). - `str` - `float` - `bool` - `group_bys: Optional[List[RunQueryParametersGroupBy]]` Define how to group the results of the query. - `type: Literal["string", "number", "boolean"]` - `"string"` - `"number"` - `"boolean"` - `value: str` - `havings: Optional[List[RunQueryParametersHaving]]` Configure the Having clauses that filter on calculations in the query result. - `key: str` - `operation: Literal["eq", "neq", "gt", 3 more]` - `"eq"` - `"neq"` - `"gt"` - `"gte"` - `"lt"` - `"lte"` - `value: float` - `limit: Optional[int]` Set a limit on the number of results / records returned by the query - `needle: Optional[RunQueryParametersNeedle]` Define an expression to search using full-text search. - `value: RunQueryParametersNeedleValue` - `is_regex: Optional[bool]` - `match_case: Optional[bool]` - `order_by: Optional[RunQueryParametersOrderBy]` Configure the order of the results returned by the query. - `value: str` Configure which Calculation to order the results by. - `order: Optional[Literal["asc", "desc"]]` Set the order of the results - `"asc"` - `"desc"` - `updated: str` - `updated_by: str` - `status: Literal["STARTED", "COMPLETED"]` Current execution status of the query run. - `"STARTED"` - `"COMPLETED"` - `timeframe: RunTimeframe` Time range for the query execution - `from_: float` Start timestamp for the query timeframe (Unix timestamp in milliseconds) - `to: float` End timestamp for the query timeframe (Unix timestamp in milliseconds) - `user_id: str` ID of the user who initiated the query run. - `created: Optional[str]` ISO-8601 timestamp when the query run was created. - `statistics: Optional[RunStatistics]` Query performance statistics from the database (does not include network latency). - `bytes_read: float` Number of uncompressed bytes read from the table. - `elapsed: float` Time in seconds for the query to run. - `rows_read: float` Number of rows scanned from the table. - `abr_level: Optional[float]` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `updated: Optional[str]` ISO-8601 timestamp when the query run was last updated. - `statistics: Statistics` Query performance statistics from the database. Includes execution time, rows scanned, and bytes read. Does not include network latency. - `bytes_read: float` Number of uncompressed bytes read from the table. - `elapsed: float` Time in seconds for the query to run. - `rows_read: float` Number of rows scanned from the table. - `abr_level: Optional[float]` The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the ABR level is 1 - `agents: Optional[List[Agent]]` Durable Object agent summaries. Present when the query view is 'agents'. Each entry represents an agent with its event counts and status. - `agent_class: str` Class name of the Durable Object agent. - `event_type_counts: Dict[str, float]` Breakdown of event counts by event type. - `first_event_ms: float` Timestamp of the earliest event from this agent in the queried window (Unix epoch ms). - `has_errors: bool` Whether the agent emitted any error events in the queried window. - `last_event_ms: float` Timestamp of the most recent event from this agent (Unix epoch ms). - `namespace: str` Durable Object namespace the agent belongs to. - `service: str` Worker service name that hosts this agent. - `total_events: float` Total number of events emitted by this agent in the queried window. - `calculations: Optional[List[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: List[CalculationAggregate]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `groups: Optional[List[CalculationAggregateGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `calculation: str` - `series: List[CalculationSeries]` - `data: List[CalculationSeriesData]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `first_seen: Optional[str]` - `groups: Optional[List[CalculationSeriesDataGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `last_seen: Optional[str]` - `time: str` - `alias: Optional[str]` - `compare: Optional[List[Compare]]` Comparison calculation results from the previous time period. Present when the compare option is enabled. Same structure as calculations. - `aggregates: List[CompareAggregate]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `groups: Optional[List[CompareAggregateGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `calculation: str` - `series: List[CompareSeries]` - `data: List[CompareSeriesData]` - `count: float` - `interval: float` - `sample_interval: float` - `value: float` - `first_seen: Optional[str]` - `groups: Optional[List[CompareSeriesDataGroup]]` - `key: str` - `value: Union[str, float, bool]` - `str` - `float` - `bool` - `last_seen: Optional[str]` - `time: str` - `alias: Optional[str]` - `events: Optional[Events]` Individual event results. Present when the query view is 'events'. Contains the matching log lines and their metadata. - `count: Optional[float]` Total number of events matching the query (may exceed the number returned due to limits). - `events: Optional[List[EventsEvent]]` List of individual telemetry events matching the query. - `metadata: EventsEventMetadata` Structured metadata extracted from the event. These fields are indexed and available for filtering and aggregation. - `id: str` Unique event ID. Use as the cursor value for offset-based pagination. - `account: Optional[str]` Cloudflare account identifier. - `cloud_service: Optional[str]` Cloudflare product that generated this event (e.g. workers, pages). - `cold_start: Optional[int]` Whether this was a cold start (1) or warm invocation (0). - `cost: Optional[int]` Estimated cost units for this invocation. - `duration: Optional[int]` Span duration in milliseconds. - `end_time: Optional[int]` Span end time as a Unix epoch in milliseconds. - `error: Optional[str]` Error message, present when the log represents an error. - `error_template: Optional[str]` Templatized version of the error message used for grouping similar errors. - `fingerprint: Optional[str]` Content-based fingerprint used to group similar events. - `level: Optional[str]` Log level (e.g. log, debug, info, warn, error). - `message: Optional[str]` Log message text. - `message_template: Optional[str]` Templatized version of the log message used for grouping similar messages. - `metric_name: Optional[str]` Metric name when the event represents a metric data point. - `origin: Optional[str]` Origin of the event (e.g. fetch, scheduled, queue). - `parent_span_id: Optional[str]` Span ID of the parent span in the trace hierarchy. - `provider: Optional[str]` Infrastructure provider identifier. - `region: Optional[str]` Cloudflare data center / region that handled the request. - `request_id: Optional[str]` Cloudflare request ID that ties all logs from a single invocation together. - `service: Optional[str]` Worker script name that produced this event. - `span_id: Optional[str]` Span ID for this individual unit of work within a trace. - `span_name: Optional[str]` Human-readable name for this span. - `stack_id: Optional[str]` Stack / deployment identifier. - `start_time: Optional[int]` Span start time as a Unix epoch in milliseconds. - `status_code: Optional[int]` HTTP response status code returned by the Worker. - `trace_duration: Optional[int]` Total duration of the entire trace in milliseconds. - `trace_id: Optional[str]` Distributed trace ID linking spans across services. - `transaction_name: Optional[str]` Logical transaction name for this request. - `trigger: Optional[str]` What triggered the invocation (e.g. GET /users, POST /orders, queue message). - `type: Optional[str]` Event type classifier (e.g. cf-worker-event, cf-worker-log). - `url: Optional[str]` Request URL that triggered the Worker invocation. - `dataset: str` The dataset this event belongs to (e.g. cloudflare-workers). - `source: Union[str, object]` Raw log payload. May be a string or a structured object depending on how the log was emitted. - `str` - `object` - `timestamp: int` Event timestamp as a Unix epoch in milliseconds. - `containers: Optional[object]` Cloudflare Containers event information that enriches your logs for identifying and debugging issues. - `workers: Optional[EventsEventWorkers]` Cloudflare Workers event information that enriches your logs for identifying and debugging issues. - `class EventsEventWorkersUnionMember0: …` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `request_id: str` - `script_name: str` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `outcome: Optional[str]` - `script_version: Optional[EventsEventWorkersUnionMember0ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `class EventsEventWorkersUnionMember1: …` - `cpu_time_ms: float` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: str` - `request_id: str` - `script_name: str` - `wall_time_ms: float` - `diagnostics_channel_events: Optional[List[EventsEventWorkersUnionMember1DiagnosticsChannelEvent]]` - `channel: str` - `message: str` - `timestamp: float` - `dispatch_namespace: Optional[str]` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `script_version: Optional[EventsEventWorkersUnionMember1ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `fields: Optional[List[EventsField]]` List of fields discovered in the matched events. Useful for building dynamic UIs. - `key: str` Field name present in the matched events. - `type: str` Data type of the field (string, number, or boolean). - `series: Optional[List[EventsSeries]]` Time-series data for the matched events, bucketed by the query granularity. - `data: List[EventsSeriesData]` - `aggregates: EventsSeriesDataAggregates` - `_count: int` - `_interval: float` - `_first_seen: Optional[str]` - `_last_seen: Optional[str]` - `bin: Optional[object]` - `count: float` - `interval: float` - `sample_interval: float` - `errors: Optional[float]` - `groups: Optional[Dict[str, Union[str, float, bool]]]` Groups in the query results. - `str` - `float` - `bool` - `time: str` - `invocations: Optional[Dict[str, List[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: InvocationMetadata` Structured metadata extracted from the event. These fields are indexed and available for filtering and aggregation. - `id: str` Unique event ID. Use as the cursor value for offset-based pagination. - `account: Optional[str]` Cloudflare account identifier. - `cloud_service: Optional[str]` Cloudflare product that generated this event (e.g. workers, pages). - `cold_start: Optional[int]` Whether this was a cold start (1) or warm invocation (0). - `cost: Optional[int]` Estimated cost units for this invocation. - `duration: Optional[int]` Span duration in milliseconds. - `end_time: Optional[int]` Span end time as a Unix epoch in milliseconds. - `error: Optional[str]` Error message, present when the log represents an error. - `error_template: Optional[str]` Templatized version of the error message used for grouping similar errors. - `fingerprint: Optional[str]` Content-based fingerprint used to group similar events. - `level: Optional[str]` Log level (e.g. log, debug, info, warn, error). - `message: Optional[str]` Log message text. - `message_template: Optional[str]` Templatized version of the log message used for grouping similar messages. - `metric_name: Optional[str]` Metric name when the event represents a metric data point. - `origin: Optional[str]` Origin of the event (e.g. fetch, scheduled, queue). - `parent_span_id: Optional[str]` Span ID of the parent span in the trace hierarchy. - `provider: Optional[str]` Infrastructure provider identifier. - `region: Optional[str]` Cloudflare data center / region that handled the request. - `request_id: Optional[str]` Cloudflare request ID that ties all logs from a single invocation together. - `service: Optional[str]` Worker script name that produced this event. - `span_id: Optional[str]` Span ID for this individual unit of work within a trace. - `span_name: Optional[str]` Human-readable name for this span. - `stack_id: Optional[str]` Stack / deployment identifier. - `start_time: Optional[int]` Span start time as a Unix epoch in milliseconds. - `status_code: Optional[int]` HTTP response status code returned by the Worker. - `trace_duration: Optional[int]` Total duration of the entire trace in milliseconds. - `trace_id: Optional[str]` Distributed trace ID linking spans across services. - `transaction_name: Optional[str]` Logical transaction name for this request. - `trigger: Optional[str]` What triggered the invocation (e.g. GET /users, POST /orders, queue message). - `type: Optional[str]` Event type classifier (e.g. cf-worker-event, cf-worker-log). - `url: Optional[str]` Request URL that triggered the Worker invocation. - `dataset: str` The dataset this event belongs to (e.g. cloudflare-workers). - `source: Union[str, object]` Raw log payload. May be a string or a structured object depending on how the log was emitted. - `str` - `object` - `timestamp: int` Event timestamp as a Unix epoch in milliseconds. - `containers: Optional[object]` Cloudflare Containers event information that enriches your logs for identifying and debugging issues. - `workers: Optional[InvocationWorkers]` Cloudflare Workers event information that enriches your logs for identifying and debugging issues. - `class InvocationWorkersUnionMember0: …` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `request_id: str` - `script_name: str` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `outcome: Optional[str]` - `script_version: Optional[InvocationWorkersUnionMember0ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `class InvocationWorkersUnionMember1: …` - `cpu_time_ms: float` - `event_type: Literal["fetch", "scheduled", "alarm", 8 more]` - `"fetch"` - `"scheduled"` - `"alarm"` - `"cron"` - `"queue"` - `"email"` - `"tail"` - `"rpc"` - `"websocket"` - `"workflow"` - `"unknown"` - `outcome: str` - `request_id: str` - `script_name: str` - `wall_time_ms: float` - `diagnostics_channel_events: Optional[List[InvocationWorkersUnionMember1DiagnosticsChannelEvent]]` - `channel: str` - `message: str` - `timestamp: float` - `dispatch_namespace: Optional[str]` - `durable_object_id: Optional[str]` - `entrypoint: Optional[str]` - `event: Optional[Dict[str, object]]` - `execution_model: Optional[Literal["durableObject", "stateless"]]` - `"durableObject"` - `"stateless"` - `script_version: Optional[InvocationWorkersUnionMember1ScriptVersion]` - `id: Optional[str]` - `message: Optional[str]` - `tag: Optional[str]` - `span_id: Optional[str]` - `trace_id: Optional[str]` - `truncated: Optional[bool]` - `traces: Optional[List[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. - `root_span_name: str` Name of the root span that initiated the trace. - `root_transaction_name: str` Logical transaction name for the root span. - `service: List[str]` List of Worker services involved in the trace. - `spans: float` Total number of spans in the trace. - `trace_duration_ms: float` Total duration of the trace in milliseconds. - `trace_end_ms: float` Trace end time as a Unix epoch in milliseconds. - `trace_id: str` Unique identifier for the distributed trace. - `trace_start_ms: float` Trace start time as a Unix epoch in milliseconds. - `errors: Optional[List[str]]` Error messages encountered during the trace, if any. ### Telemetry Values Response - `class TelemetryValuesResponse: …` - `dataset: str` - `key: str` - `type: Literal["string", "boolean", "number"]` - `"string"` - `"boolean"` - `"number"` - `value: Union[str, float, bool]` - `str` - `float` - `bool` # Destinations ## Get Destinations `workers.observability.destinations.list(DestinationListParams**kwargs) -> SyncSinglePage[DestinationListResponse]` **get** `/accounts/{account_id}/workers/observability/destinations` List your Workers Observability Telemetry Destinations. ### Parameters - `account_id: str` - `order: Optional[Literal["asc", "desc"]]` - `"asc"` - `"desc"` - `order_by: Optional[Literal["created", "updated"]]` - `"created"` - `"updated"` - `page: Optional[float]` - `per_page: Optional[float]` ### Returns - `class DestinationListResponse: …` - `configuration: Configuration` - `destination_conf: str` - `headers: Dict[str, str]` - `job_status: ConfigurationJobStatus` - `error_message: str` - `last_complete: str` - `last_error: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) page = client.workers.observability.destinations.list( account_id="account_id", ) page = page.result[0] print(page.configuration) ``` #### 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 `workers.observability.destinations.create(DestinationCreateParams**kwargs) -> DestinationCreateResponse` **post** `/accounts/{account_id}/workers/observability/destinations` Create a new Workers Observability Telemetry Destination. ### Parameters - `account_id: str` - `configuration: Configuration` - `headers: Dict[str, str]` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `skip_preflight_check: Optional[bool]` ### Returns - `class DestinationCreateResponse: …` - `configuration: Configuration` - `destination_conf: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpush_job: float` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) destination = client.workers.observability.destinations.create( account_id="account_id", configuration={ "headers": { "foo": "string" }, "logpush_dataset": "opentelemetry-traces", "type": "logpush", "url": "url", }, enabled=True, name="name", ) print(destination.configuration) ``` #### 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 `workers.observability.destinations.update(strslug, DestinationUpdateParams**kwargs) -> DestinationUpdateResponse` **patch** `/accounts/{account_id}/workers/observability/destinations/{slug}` Update an existing Workers Observability Telemetry Destination. ### Parameters - `account_id: str` - `slug: str` - `configuration: Configuration` - `headers: Dict[str, str]` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` ### Returns - `class DestinationUpdateResponse: …` - `configuration: Configuration` - `destination_conf: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpush_job: float` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) destination = client.workers.observability.destinations.update( slug="slug", account_id="account_id", configuration={ "headers": { "foo": "string" }, "type": "logpush", "url": "url", }, enabled=True, ) print(destination.configuration) ``` #### 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 `workers.observability.destinations.delete(strslug, DestinationDeleteParams**kwargs) -> DestinationDeleteResponse` **delete** `/accounts/{account_id}/workers/observability/destinations/{slug}` Delete a Workers Observability Telemetry Destination. ### Parameters - `account_id: str` - `slug: str` ### Returns - `class DestinationDeleteResponse: …` - `configuration: Configuration` - `destination_conf: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpush_job: float` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) destination = client.workers.observability.destinations.delete( slug="slug", account_id="account_id", ) print(destination.configuration) ``` #### 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 - `class DestinationListResponse: …` - `configuration: Configuration` - `destination_conf: str` - `headers: Dict[str, str]` - `job_status: ConfigurationJobStatus` - `error_message: str` - `last_complete: str` - `last_error: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str` ### Destination Create Response - `class DestinationCreateResponse: …` - `configuration: Configuration` - `destination_conf: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpush_job: float` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str` ### Destination Update Response - `class DestinationUpdateResponse: …` - `configuration: Configuration` - `destination_conf: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpush_job: float` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str` ### Destination Delete Response - `class DestinationDeleteResponse: …` - `configuration: Configuration` - `destination_conf: str` - `logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"]` - `"opentelemetry-traces"` - `"opentelemetry-logs"` - `logpush_job: float` - `type: Literal["logpush"]` - `"logpush"` - `url: str` - `enabled: bool` - `name: str` - `scripts: List[str]` - `slug: str`