Skip to content

Commit 719df4b

Browse files
authored
Remove traceparent docs (#13686)
We currently have no plans to add support for the W3C `traceparent` header in our SDKs. Removing the docs around this.
1 parent 8581f18 commit 719df4b

File tree

4 files changed

+15
-32
lines changed

4 files changed

+15
-32
lines changed

develop-docs/sdk/expected-features/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ If Performance Monitoring is both supported by the SDK and enabled in the client
326326
- operation: `http.client`
327327
- description: `$METHOD $url` (uppercase HTTP method), e.g. `GET https://sentry.io`
328328
- HTTP requests must be enhanced with a [`sentry-trace` HTTP header](/sdk/telemetry/traces/#header-sentry-trace) to support [distributed tracing](https://docs.sentry.io/product/sentry-basics/tracing/distributed-tracing)
329-
- HTTP requests must be enhanced with a [`traceparent` HTTP header](/sdk/telemetry/traces/#header-traceparent) to support [distributed tracing](https://docs.sentry.io/product/sentry-basics/tracing/distributed-tracing)
330329
- HTTP requests must be enhanced with a [`baggage` HTTP header](/sdk/telemetry/traces/dynamic-sampling-context/#baggage-header) to support [dynamic sampling](/sdk/telemetry/traces/dynamic-sampling-context/)
331330
- span status must match HTTP response status code ([see Span status to HTTP status code mapping](/sdk/data-model/event-payloads/span/))
332331
- when network error occurs, span status must be set to `internal_error`

develop-docs/sdk/telemetry/traces/distributed-tracing/index.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@ This document describes how an SDK should propagate information between differen
66

77
For an overview see [Distributed Tracing](https://docs.sentry.io/product/performance/distributed-tracing/) in the product docs.
88

9-
Sentry uses three containers to hold trace information [`sentry-trace`](/sdk/performance/#header-sentry-trace), [`traceparent`](/sdk/performance/#header-traceparent) and [`baggage`](/sdk/performance/dynamic-sampling-context/#baggage-header).
9+
Sentry uses two containers to hold trace information [`sentry-trace`](/sdk/performance/#header-sentry-trace) and [`baggage`](/sdk/performance/dynamic-sampling-context/#baggage-header).
1010

1111
With these containers you can propagate a trace to a down-stream service by either:
12-
- adding `sentry-trace`, `traceparent` and `baggage` HTTP headers (when making outgoing HTTP requests),
13-
- adding `sentry-trace`, `traceparent` and `baggage` as meta data (when putting tasks into a queue, details are specific to the queue you want to support), or
14-
- setting environment variables (when calling another process). In this case the env variables should be called `SENTRY_TRACE`, `SENTRY_TRACEPARENT` and `SENTRY_BAGGAGE`.
12+
- adding `sentry-trace` and `baggage` HTTP headers (when making outgoing HTTP requests),
13+
- adding `sentry-trace` and `baggage` as meta data (when putting tasks into a queue, details are specific to the queue you want to support), or
14+
- setting environment variables (when calling another process). In this case the env variables should be called `SENTRY_TRACE` and `SENTRY_BAGGAGE`.
1515

1616
The SDK running in the receiving service needs to make sure to pick up incoming trace information by
17-
- reading `sentry-trace`, `traceparent` and `baggage` headers for each incoming HTTP request,
18-
- reading `sentry-trace`, `traceparent` and `baggage` meta data when retrieving an item from a queue, or
19-
- reading the environment variables `SENTRY_TRACE`, `SENTRY_TRACEPARENT` and `SENTRY_BAGGAGE` on startup.
20-
21-
In case both `sentry-trace` and `traceparent` are present, `sentry-trace` takes precedence.
17+
- reading `sentry-trace` and `baggage` headers for each incoming HTTP request,
18+
- reading `sentry-trace` and `baggage` meta data when retrieving an item from a queue, or
19+
- reading the environment variables `SENTRY_TRACE` and `SENTRY_BAGGAGE` on startup.
2220

2321
This trace information should be stored in the "propagation context" of the current scope. This makes sure that all telemetry that is emitted from the receiving service to Sentry will include the correct trace information.

develop-docs/sdk/telemetry/traces/dynamic-sampling-context.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Any values on the DSC should be propagated "as is" - this includes values like "
170170

171171
SDKs should recognize incoming requests as "instrumented" or "traced" when at least one of the following applies:
172172

173-
- The incoming request has a `sentry-trace` and/or `traceparent` header
173+
- The incoming request has a `sentry-trace` header
174174
- The incoming request has a `baggage` header containing one or more keys starting with "`sentry-`"
175175

176176
After the DSC of a particular trace has been frozen, API calls like `set_user` should have no effect on the DSC.
@@ -189,7 +189,7 @@ def has_sentry_value_in_baggage_header(request):
189189
# header of `request`, for which the key starts with "sentry-". Otherwise, it returns False.
190190

191191
def on_incoming_request(request):
192-
if (request.has_header("sentry-trace") or request.has_header("traceparent")) and (not request.has_header("baggage") or not has_sentry_value_in_baggage_header(request)):
192+
if request.has_header("sentry-trace") and (not request.has_header("baggage") or not has_sentry_value_in_baggage_header(request)):
193193
# Request comes from an old SDK which doesn't support Dynamic Sampling Context yet
194194
# --> we don't propagate baggage for this trace
195195
current_transaction.dynamic_sampling_context_frozen = True
@@ -237,12 +237,12 @@ Here's an example of that flow:
237237

238238
- Page starts loading
239239
- Sentry initializes and starts `pageload` transaction
240-
- Page makes HTTP request to user service to get user (propagates sentry-trace/traceparent/baggage to user service)
240+
- Page makes HTTP request to user service to get user (propagates sentry-trace/baggage to user service)
241241
- user service continues trace by automatically creating sampling transaction
242-
- user service pings database service (propagates sentry-trace/traceparent/baggage to database service)
242+
- user service pings database service (propagates sentry-trace/baggage to database service)
243243
- database service continues trace by automatically creating sampling transaction
244244
- Page gets data from user service, calls `Sentry.setUser` and sets `user_segment`
245-
- Page makes HTTP requests to service A, service B, and service C (propagates sentry-trace/traceparent/baggage to services A, B and C)
245+
- Page makes HTTP requests to service A, service B, and service C (propagates sentry-trace/baggage to services A, B and C)
246246
- DSC is propagated with baggage to service A, service B, and service C, so 3 child transactions
247247
- Page finishes loading, finishing `pageload` transaction, which is sent to Sentry
248248

@@ -258,7 +258,7 @@ To illustrate this, let's look at another example:
258258

259259
- Page starts loading
260260
- Sentry initializes and starts `pageload` transaction (with transaction name `/teams/123/user/456` - based on window URL)
261-
- Page makes HTTP request to service A (propagates sentry-trace/traceparent/baggage to user service)
261+
- Page makes HTTP request to service A (propagates sentry-trace/baggage to user service)
262262
- Page renders with react router, triggering parameterization of transaction name (`/teams/123/user/456` -> `/teams/:id/user/:id`).
263263
- Page finishes loading, finishing `pageload` transaction, which is sent to Sentry
264264

develop-docs/sdk/telemetry/traces/index.mdx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This option takes an array of strings and/or regular expressions. SDKs should on
5252

5353
SDKs may choose a default value which makes sense for their use case. Most SDKs default to the regex `.*` (meaning they attach headers to all outgoing requests), but deviation is allowed if necessary. For example, because of CORS, browser-based SDKs default to only adding headers to domain-internal requests.
5454

55-
See [`sentry-trace`](#header-sentry-trace), [`traceparent`](#header-traceparent) and [`baggage`](/sdk/performance/dynamic-sampling-context/#baggage-header) for more details on the individual headers which are attached to outgoing requests.
55+
See [`sentry-trace`](#header-sentry-trace) and [`baggage`](/sdk/performance/dynamic-sampling-context/#baggage-header) for more details on the individual headers which are attached to outgoing requests.
5656

5757
#### Example
5858

@@ -154,8 +154,7 @@ tree as well as the unit of reporting to Sentry.
154154
- `Span` should have a method `startChild` which creates a new span with the current span's id as the new span's `parentSpanId` and the current span's `sampled` value copied over to the new span's `sampled` property
155155
- The `startChild` method should respect the `maxSpans` limit, and once the limit is reached the SDK should not create new child spans for the given transaction.
156156
- `Span` should have a method called `toSentryTrace` which returns a string that could be sent as a header called `sentry-trace`.
157-
- `Span` should have a method called `toW3CTrace` which returns a string that could be sent as a header called `traceparent`.
158-
- `Span` should have a method called `iterHeaders` (adapt to platform's naming conventions) that returns an iterable or map of header names and values. This is a thin wrapper containing `return {"sentry-trace": toSentryTrace(), "traceparent": toW3CTrace()}` right now. See `continueFromHeaders` as to why this exists and should be preferred when writing integrations.
157+
- `Span` should have a method called `iterHeaders` (adapt to platform's naming conventions) that returns an iterable or map of header names and values. This is a thin wrapper containing `return {"sentry-trace": toSentryTrace()}` right now. See `continueFromHeaders` as to why this exists and should be preferred when writing integrations.
159158

160159
- `Transaction` Interface
161160

@@ -165,7 +164,6 @@ tree as well as the unit of reporting to Sentry.
165164
- Since a `Transaction` inherits a `Span` it has all functions available and can be interacted with like it was a `Span`
166165
- A transaction is either sampled (`sampled = true`) or unsampled (`sampled = false`), a decision which is either inherited or set once during the transaction's lifetime, and in either case is propagated to all children. Unsampled transactions should not be sent to Sentry.
167166
- `TransactionContext` should have a static/ctor method called `fromSentryTrace` which prefills a `TransactionContext` with data received from a `sentry-trace` header value
168-
- `TransactionContext` should have a static/ctor method called `fromW3CTrace` which prefills a `TransactionContext` with data received from a `traceparent` header value
169167
- `TransactionContext` should have a static/ctor method called `continueFromHeaders(headerMap)` which is really just a thin wrapper around `fromSentryTrace(headerMap.get("sentry-trace"))` right now. This should be preferred by integration/framework-sdk authors over `fromSentryTrace` as it hides the exact header names used deeper in the core sdk, and leaves opportunity for using additional headers (from the W3C) in the future without changing all integrations.
170168

171169
- `Span.finish()`
@@ -302,18 +300,6 @@ Besides the [usual reasons to use \*defer](https://github.com/apache/incubator-z
302300

303301
Which in reality is useful for proxies to set it to `0` and opt out of tracing.
304302

305-
## Header `traceparent`
306-
307-
The header is used for trace propagation. SDKs use the header to continue traces from upstream services (e.g. incoming HTTP requests), and to propagate tracing information to downstream services (e.g. outgoing HTTP requests).
308-
309-
`traceparent = version-traceid-spanid-traceflags`
310-
311-
We can assume a version of `00`, as well as traceflags being either `-00` or `-01`.
312-
A deferred sampling decision is not part of the specfication.
313-
See [W3C `traceparent` header](https://www.w3.org/TR/trace-context/#traceparent-header) for more information.
314-
315-
The `traceparent` header should only be attached to an outgoing request if the request's URL matches at least one entry of the [`tracePropagationTargets`](#tracepropagationtargets) SDK option or this option is set to `null` or not set.
316-
317303
## Static API Changes
318304

319305
The `Sentry.startTransaction` function should take two arguments - the `transactionContext` passed to the `Transaction` constructor and an optional `customSamplingContext` object containing data to be passed to `tracesSampler` (if defined).

0 commit comments

Comments
 (0)