Execution context — only waitUntil is required. Pass undefined during SSG/prerender.
OptionalenvEnvironment variable map forwarded to the SDK.
Accepts Record<string, unknown> for compatibility with Cloudflare's
Env bindings — only string values are read.
When used via instrument, this is merged with the fetch env
bindings, but fetch env takes precedence on key conflicts.
OptionalexporterBase OTLP HTTP endpoint (e.g. "https://otel.example.com").
The SDK appends per-signal paths (/v1/traces, /v1/metrics, /v1/logs)
automatically. Use signal-specific endpoints to override individual signals.
OptionalexporterAdditional headers sent with every OTLP export request (e.g. auth tokens).
The handler to call inside the traced span.
OptionalinstrumentationsOpenTelemetry instrumentations to register (Node only).
OptionalloggerLogger for automatic request/response logging.
When true or omitted, uses getLogger(). When a Logger instance, uses that.
When false, no automatic logging is performed.
OptionallogsSignal-specific OTLP endpoint for logs (full URL, no suffix appended).
OptionalmaxMaximum bytes to read from request/response bodies for logging.
OptionalmetricsOTLP HTTP endpoint for the metrics exporter. Falls back to exporterEndpoint + /v1/metrics when omitted.
OptionalmetricsMetrics collection interval in milliseconds (default 60000).
OptionalonOptional callback invoked via ctx.waitUntil after the span ends.
The incoming Request to trace.
OptionalresourceExtra key/value pairs merged into the OpenTelemetry Resource.
OptionalsensitiveHeader names whose values are replaced with "[REDACTED]" in logs.
Overrides the default set (authorization, cookie, set-cookie, x-api-key, proxy-authorization).
OptionalserviceThe logical name of the service reported in every span.
OptionaltracesSignal-specific OTLP endpoint for traces (full URL, no suffix appended).
Options for traceHandler.