Skip to content
Start here

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.

Security
API Email + API Key

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

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

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

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

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
User Service Key

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

Example:X-Auth-User-Service-Key: v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719
Accepted Permissions (at least one required)
Workers Observability Write
ParametersExpand Collapse
account_id: str
datasets: Optional[SequenceNotStr[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.

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

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

key: str

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

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

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

One of the following:
str
float
bool
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]
maxLength1000
One of the following:
str
float
bool
is_regex: Optional[bool]
match_case: Optional[bool]
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]
maxLength1000
One of the following:
str
float
bool
is_regex: Optional[bool]
match_case: Optional[bool]
to: Optional[float]
ReturnsExpand Collapse
class TelemetryKeysResponse:
key: str
last_seen_at: float
type: Literal["string", "boolean", "number"]
One of the following:
"string"
"boolean"
"number"

List keys

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)
{
  "errors": [
    {
      "message": "message"
    }
  ],
  "messages": [
    {
      "message": "Successful request"
    }
  ],
  "result": [
    {
      "key": "key",
      "lastSeenAt": 0,
      "type": "string"
    }
  ],
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "message": "message"
    }
  ],
  "messages": [
    {
      "message": "Successful request"
    }
  ],
  "result": [
    {
      "key": "key",
      "lastSeenAt": 0,
      "type": "string"
    }
  ],
  "success": true
}