You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/observability/traces/index.mdx
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,7 @@ pcx_content_type: navigation
3
3
title: Traces
4
4
sidebar:
5
5
order: 3
6
-
group:
7
-
hideIndex: false
6
+
8
7
---
9
8
10
9
## What is Workers tracing?
@@ -16,13 +15,13 @@ With tracing you can answer questions such as:
16
15
* How long do subrequests to my Worker take?
17
16
* How long are my requests to my KV Namespace or R2 bucket taking?
18
17
19
-
## Automatic instrumentation
18
+
Take for example, an application that handles online ordering and makes request to a D1 Database to fetch customer information, an external API to validate payment information, and a Cloudflare Queue to submit the order. Tracing lets you visualize an invocation call by call at each part of the request journey. Our example may look something like this:
20
19
21
-
Each trace consists of one or more spans, representing the various calls made to different Worker services as part of the invocation. Cloudflare has automatically instrumented fetch calls and requests to Cloudflare resources (e.g. Workers KV, D1 Databases, Durable Objects) bound to your Workers application, without requiring you to install and configure an OpenTelemetry SDK.
20
+
**TODO: insert example of trace here**
22
21
23
-
Take for example, an application that handles online ordering and makes request to a D1 Database to fetch customer information, an external API to validate payment information, and a Cloudflare Queue to submit the order. Tracing lets you visualize an invocation call by call at each part of the request journey. Our example above may look something like this:
22
+
## Automatic instrumentation
24
23
25
-
**TODO: insert example of trace here**
24
+
Each trace consists of one or more spans, representing the various calls made to different Worker services as part of the invocation. Cloudflare has **automatically** instrumented things like fetch calls and calls to Cloudflare bindings (e.g. Workers KV, D1 Databases, Durable Objects) on your Workers application, without requiring you to install and configure an OpenTelemetry SDK. Just enable on your Worker and you will automatically start emitting traces.
26
25
27
26
While our work for automatic instrumentation is ongoing, we've [documented](/workers/observability/traces/spans-and-attributes) all existing spans and attributes currently instrumented today.
28
27
@@ -45,7 +44,7 @@ To view traces in the Workers dashboard, you can set the following in your Wrang
45
44
You can also export [OpenTelemetry](https://opentelemetry.io/) (OTel) traces to a 3rd party destination such as Honeycomb by [setting up an external destination](/workers/observability/exporting-opentelemetry-data) in the Cloudflare dashboard and setting that destination in your Wrangler configuration file.
46
45
47
46
## Head-based sampling
48
-
Head-based sampling allows you to trace a percentage of incoming requests in your Cloudflare Worker. With sampling, you can help reduce volume and manage costs, while still providing meaningful insights into your application. You can configure head-based sampling for both tracing and logging separately on a per-Worker basis.
47
+
Head-based sampling allows you to trace a percentage of incoming requests in your Cloudflare Worker. With sampling, you can help reduce volume and manage costs, while still providing meaningful insights into your application.
49
48
50
49
The valid range is from 0 to 1, where 0 indicates zero out of one hundred invocations will be traced, and 1 indicates every requests will be traced. If `head_sampling_rate` is unspecified, it defaults to tracing 100% of requests.
51
50
@@ -64,7 +63,7 @@ You can configure `head_sampling_rate` in your Wrangler configuration. If you ha
64
63
"logging": {
65
64
"enabled":true
66
65
// set logging sampling rate to 50%
67
-
"head_sampling_rate":0.5
66
+
"head_sampling_rate":0.6
68
67
}
69
68
}
70
69
```
@@ -75,14 +74,14 @@ Workers tracing is currently **free** during the early beta period. This include
75
74
76
75
Starting on xx/xx/xxxx, tracing will be billed as part of Workers observability. Each span in a trace counts as one observability event, sharing the same monthly quota and pricing as [Workers logs](https://developers.cloudflare.com/workers/platform/pricing/#workers-logs):
77
76
78
-
|| Events (trace spans or log events) | Retention |
77
+
|| Events (trace spans or log events) | Retention |
|**Workers Paid**| 10 million included per month <br /> +$0.05 per additional 100,000 events |30 Days |
79
+
|**Workers Free**|200,000 per day | 3 Days |
80
+
|**Workers Paid**| 10 million included per month +$0.60 per additional million events |7 Days |
82
81
83
82
On xx/xx/xxxx, you will start being billed for your tracing usage.
84
83
85
-
## Known issues
86
-
- Trace context propagation
87
-
- Custom spans and attributes
84
+
Workers tracing is currently in open beta. This page documents current limitations and any features on our roadmap. To provide more feedback and feature requests please [reach out to us](link).
Workers tracing is currently in open beta. This page documents current limitations and any features on our roadmap. To provide more feedback and feature requests please [reach out to us](link).
11
+
12
+
### Support for more spans and attributes
13
+
We are adding more automatic instrumentation for every part of the Workers platform. While we first want to give you visibility into the duration of every operation w ithin your request, we also want to add more detailed attributes which are crucial to debugging your app. You can find a complete list of what is already instrumented [here](link). Your feedback on what’s missing will be extremely valuable [here](link).
14
+
15
+
### Trace context propagation
16
+
One of the most critical aspects of distributed tracing is ensuring trace context flows seamlessly across service boundaries and automatically linking spans together to create complete, end-to-end visibility. When fully implemented, our automatic trace context propagation will follow W3C standards to ensure compatibility across your existing tools and services.
17
+
18
+
### Support for custom spans and attributes:
19
+
While automatic instrumentation covers the platform interactions, we know you need visibility into your own application logic too. We're working on the ability to create custom spans around your use case and other application-specific operations that matter most to your debugging workflow.
0 commit comments