本页还没有译文
本页 11 段还没译成繁體中文,下面显示的是英文原文。OpenTelemetry export
还没翻译译自英文(developers.cloudflare.com)本页 11 段都还没译
Workers can export OpenTelemetry-compliant logs and traces to external destinations. First, create a destination and configure your provider.
Supported telemetry
You can export these Workers telemetry types:
- Traces - Request flows through your Worker and connected services
- Logs - Application and system logs, including
console.log()output
Configure export
Add your destination names to your Wrangler configuration. Each name must match a destination configured in the dashboard.
{
"observability": {
"traces": {
"enabled": true,
"destinations": ["tracing-destination-name"],
// traces sample rate of 5%
"head_sampling_rate": 0.05,
// optional: export without storing traces in Cloudflare
"persist": false
},
"logs": {
"enabled": true,
"destinations": ["logs-destination-name"],
// logs sample rate of 60%
"head_sampling_rate": 0.6,
// optional: export without storing logs in Cloudflare
"persist": false
}
}
}[observability.traces]
enabled = true
destinations = [ "tracing-destination-name" ]
head_sampling_rate = 0.05
persist = false
[observability.logs]
enabled = true
destinations = [ "logs-destination-name" ]
head_sampling_rate = 0.6
persist = false
`persist` and pricing
By default, persist is true. Logs and traces are exported and stored in Cloudflare. Beginning December 1, 2026, persisted data contributes to Cloudflare Observability ingestion and storage usage. Set persist to false if you only need data in your external destination.
Redeploy your Worker after updating its Wrangler configuration. Events may take several minutes to reach your destination.
Known limitations
Workers infrastructure metrics and custom metrics cannot be exported through OpenTelemetry.