Skip to content

Worker observability

Use your organization’s console to understand application usage and investigate failures. Its telemetry is scoped to your organization and Worker permissions.

Choose the right view

Open Observability, beside organization Overview, to see all authorized Workers in the current organization. Select one or more Workers to focus the investigation, or use View observability from a Worker’s detail page. Three focused views keep concerns separate:

  • Overview summarizes total invocations, failures, background activity, and active Workers. Its bounded ranking highlights the ten busiest Workers in the selected window instead of turning the overview into a resource directory. This is the closest view of allowance consumption because every supported activation counts as one Worker invocation.
  • Invocations puts HTTP, queue, scheduled, alarm, service-binding, and other activations on one rate-and-outcome timeline. Search and filter the execution list here, then open an invocation to inspect its trace waterfall, spans, and correlated logs. Its invocation-type facet reveals protocol-specific detail: HTTP status and response duration for requests, or queue-handler duration for queue consumers.
  • Logs keeps application events and their filters together, with a bounded scroll area and live/pause controls. Expand an event for structured runtime evidence and a direct link to its trace when one is available.

Overview also ranks the ten most active Workers by invocation count and failure rate, with links to a focused invocation view. When failures exist, Failure signals groups them by runtime outcome and activation path. Select an outcome such as CPU limit exceeded, Memory limit exceeded, or Exception to open the matching invocation logs with the Worker, time window, event type, and outcome already selected. These are retained telemetry, not the authoritative quota ledger. Organization percentiles use combined observations, not averages of per-Worker percentiles.

Deployment markers appear when a Worker is selected. Observability is separate from Worker overview and version detail so traffic history is not confused with an individual deployment artifact.

Time range applies throughout; version selection is available only for a selected Worker. Filters apply where the selected view supports them. Invocation type selects runtime activity. HTTP status and method become available when the HTTP facet is selected. Level and text search are local to Logs. Filters carried into Logs from a metrics investigation appear as removable filter chips. The selected view and all filter state are represented in the URL, so an investigation survives refresh and can be shared or bookmarked.

Organization invocation overview and Worker activity

HTTP invocation traffic and duration distribution

Use Live to stream recent application logs, then Pause to freeze the view. Resuming catches up from the saved cursor where possible. Live delivery is best effort: it polls stored records every two seconds, limits streams and history, and explicitly indicates gaps. It is not an audit log.

The runtime assigns one trace ID and invocation ID to an activation and the application logs, exception records, and completion record emitted within it. An open trace keeps that evidence in one investigation: event markers appear on their spans and the selected-span inspector expands the correlated records inline. Search span operations, resource names, attributes, and event messages, or narrow the waterfall to errors or spans with events. These filters, the invocation, and the selected span stay in the URL. Browser history returns to the scoped invocation list. From an expanded record on the Logs page, select Open invocation to inspect the same execution and span. Raw telemetry remains a disclosure for supporting evidence rather than the primary interface.

Organization log investigation with adjacent filters and live controls

The console authorizes every telemetry request with the current organization’s workers.read access and Worker scope. One tenant cannot query another tenant’s traffic, logs, or version history.

What the charts mean

Request counts and durations come from HAProxy completion records collected by Alloy into Loki. Response duration is HAProxy total active time (Ta) in milliseconds: it includes Worker execution and response transfer through the proxy, but not client DNS/TCP setup or a direct Worker CPU measurement.

Request-rate charts draw a zero for known idle intervals. Duration heat maps show the number of observations in each time and duration band; quiet intervals remain empty because zero is not a duration sample. Their compact p95 and p99 values are the most recent observed percentiles in the selected window. Charts show a degraded state when collection health, freshness, or parsing signals fail. Healthy collection is not a guarantee of lossless delivery and these values are not billing counters.

Ingress protection decisions live under Security → Events. Requests blocked there never reach application code and are excluded from application request charts and logs. Observe-mode requests that reach the Worker remain ordinary application traffic.

The runtime tail consumer records every invocation’s event type, outcome, queue name, and batch size. That puts queue consumers, Workflow and Worker service calls, HTTP requests, and other activations on the same metered execution view without pretending they expose identical protocol details. Queue handler duration is measured independently by the queue service around the complete consumer call, including Worker code and its bindings. Selecting the Queue facet adds the same duration-distribution heat map and compact p95/p99 context. Queue histograms are not labeled by deployment version, so the console does not display them while a version filter is active.

Queue invocation rate and handler duration

The streaming runtime tail reports per-invocation wall and CPU duration when the runtime supplies them. These are investigation evidence, not the authoritative quota ledger or a memory reservation. Shared runtime CPU and memory pressure still belongs in the administrator’s Fleet views rather than being presented as fictional per-Worker allocation.

Application console.* output and uncaught exceptions are exported by a platform-owned workerd tail consumer after an invocation completes. Messages may therefore arrive after the response, especially for waitUntil() work. Application text is untrusted, bounded, and rendered as text; applications remain responsible for not logging secrets.

Add application spans

Workers can add application-specific operations to the invocation trace with the native tracing API. Enable tracing in wrangler.jsonc, then use the tracer on the event’s execution context:

{
  "observability": {
    "enabled": true,
    "traces": { "enabled": true, "head_sampling_rate": 1 },
  },
}
export default {
  async fetch(request, env, ctx) {
    return ctx.tracing.enterSpan("app.orders.validate", async (span) => {
      span.setAttribute("app.orders.kind", "checkout");
      return validateOrder(request, env);
    });
  },
};

Names and attributes use an application-owned app.* namespace. Attribute values must be strings, numbers, or booleans. Keep identifiers bounded and do not attach credentials, request bodies, personal data, or other secrets. These spans inherit the active Worker invocation, so binding calls made inside them appear as children without an ingest token or a separate network request.

Platform bindings add their own safe child-span metadata. In particular, AI.run() records the requested model, task, outcome, provider duration, and provider-reported input, output, cache-read, and cache-write token counts on the ai.run span. The Observability Overview aggregates the same counts for the selected time and Workers. Prompts, responses, provider credentials, and model result bodies are not recorded.

The uptime example’s shared/telemetry/spans.mjs is a small optional helper around this API. It instruments monitor loading, the request sequence, result storage, and result publication. It is ordinary application code and can be copied or adapted; the platform does not require a proprietary SDK.

This Worker API is the supported tenant ingest path for application spans. Browser and off-platform OTLP ingest are not currently exposed to tenants.

Emit structured logs and application metrics

Declare the platform telemetry capability with Wrangler. The current Wrangler schema carries this Ermahgerd binding through its supported extension field:

{
  "unsafe": {
    "bindings": [{ "name": "TELEMETRY", "type": "telemetry" }],
  },
}

The binding exposes log(level, message, attributes), count(name, value, attributes), histogram(name, value, attributes), and a bounded emit(events) batch. Await the returned promise, or attach it to the event’s waitUntil() lifetime. The uptime applications use the small shared/telemetry/client.mjs helper to combine these methods with native spans:

const telemetry = createTelemetry(env.TELEMETRY, tracing, ctx);
await telemetry.emit([
  {
    type: "counter",
    name: "uptime.checks",
    value: 1,
    attributes: { outcome: result.outcome },
  },
  {
    type: "histogram",
    name: "uptime.duration_ms",
    value: result.durationMs,
    attributes: { outcome: result.outcome },
  },
]);

Names are lowercase identifiers. An event accepts at most eight scalar attributes, string values are limited to 128 characters, logs to 2 KiB, batches to 25 events and 32 KiB. The trusted binding supplies organization, Worker, and version identity; application input cannot override it. Accepted events count against the organization’s monthly application-telemetry allowance. Logs appear under Observability → Logs and counter/histogram summaries appear on the Observability overview. The example helper gives each batch a UUIDv4 correlation identifier, records it on an app.telemetry.emit span, and passes the same value to the binding for validation and ingestion. When a trace is opened, the console uses that identifier to place retained application logs beside the spans that emitted them even when the internal service hop could not propagate traceparent. Pass the handler’s execution context (or Durable Object state) to the helper. It retains export promises with ctx.waitUntil(), so response delivery and application steps do not wait for the telemetry receiver. An export failure is reported as a warning without changing the application’s result. The return value indicates scheduling, not successful storage. Without an execution context, the helper remains awaitable for scripts and tests and returns false when delivery fails.

Follow binding calls in invocation traces

Open Invocations and select any combination of Workers. Choose an invocation type, enable With errors, or use Add filter to set a minimum or maximum duration in milliseconds. Search an operation such as ai.run or d1.query to find traces containing that call, even when it is a child span. These filters search stored telemetry, not just the rows already on screen.

Results show the newest 100 matching traces at most, with 10 rows per page by default. Sort those retrieved results by recency, duration, or number of error spans. When the search reaches its cap, narrow the conditions or time window; pagination does not extend into older history. Not recorded means timing was not supplied, not that an execution was instantaneous. Error counts refer to spans: a failed dependency does not necessarily mean the entire invocation failed.

Select an operation name to see platform binding operations nested beneath the runtime request or background handler. Returning to the results preserves the search, sort, and page. The platform automatically records D1, R2, Queues, Key-value, Cache, static assets, Images, AI, Vectorize, and Worker service-binding calls. Application app.* spans provide the business operations around those calls. Each span identifies the capability, operation, bounded resource name, service resource, outcome, duration, and any correlated retained event. D1 spans include a redacted query shape, rows returned, rows written, changes, database size, and SQL duration. Native D1 may additionally report rows read when the SQLite engine exposes that value; returned rows are never mislabeled as scanned rows. R2 spans include operation, success, known request or response byte counts, and trusted service-side upload and finalization timing for writes. Compare those phases to the complete span duration to distinguish caller/body transfer delay from durable storage work. SQL literals and comments, object keys and contents, queue messages, model prompts, credentials, request bodies, and query strings are not retained.

Binding execution is exported as a neutral platform resource rather than being assigned tenant identity by an internal child stream. The console joins those spans only when Tempo returns them in the same trace as an authenticated Worker invocation and the complete trace contains exactly one organization matching the current session. A conflicting organization or an unexpected telemetry namespace makes the lookup fail closed.

Stateful and scheduled work

Compute → Durable Objects is the authority for member placement, namespace identity, observed object files and storage bytes, plus deployment, recovery, and restart history. A stateful Worker’s detail page links there with that Worker selected instead of duplicating the stateful management surface. These values describe state ownership and lifecycle, not per-object CPU or memory reservations.

Compute → Schedules shows trigger state and last delivery outcomes, with links into each Worker’s scheduled invocations and logs. Pausing a schedule stops new delivery, not telemetry collection.

Images usage and activity

Media → Images shows organization-scoped operation rate, sampled p95 duration, and recent transformations. These views query structured Images operation logs, not the service’s fleet-wide Prometheus counters. Duration covers the service operation including input and response transfer. Rejections and quota enforcement are visible without being described as platform outages.

The Workers tab lists current bindings, while Activity retains a bounded, paginated view of the latest 200 operations in the selected time window. The monthly quota ledger remains the authoritative usage count; retained telemetry is diagnostic evidence and can cover a different interval. For platform health and service measurements, operators use Platform observability. Organization limits are described in Usage and quotas.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close