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: develop-docs/sdk/expected-features/index.mdx
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -326,7 +326,6 @@ If Performance Monitoring is both supported by the SDK and enabled in the client
326
326
- operation: `http.client`
327
327
- description: `$METHOD $url` (uppercase HTTP method), e.g. `GET https://sentry.io`
328
328
- 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)
330
329
- 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/)
331
330
- span status must match HTTP response status code ([see Span status to HTTP status code mapping](/sdk/data-model/event-payloads/span/))
332
331
- when network error occurs, span status must be set to `internal_error`
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/traces/distributed-tracing/index.mdx
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,16 @@ This document describes how an SDK should propagate information between differen
6
6
7
7
For an overview see [Distributed Tracing](https://docs.sentry.io/product/performance/distributed-tracing/) in the product docs.
8
8
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).
10
10
11
11
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`.
15
15
16
16
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.
22
20
23
21
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.
# header of `request`, for which the key starts with "sentry-". Otherwise, it returns False.
190
190
191
191
defon_incoming_request(request):
192
-
if(request.has_header("sentry-trace") or request.has_header("traceparent")) and (not request.has_header("baggage") ornot has_sentry_value_in_baggage_header(request)):
192
+
if request.has_header("sentry-trace") and (not request.has_header("baggage") ornot has_sentry_value_in_baggage_header(request)):
193
193
# Request comes from an old SDK which doesn't support Dynamic Sampling Context yet
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/traces/index.mdx
+2-16Lines changed: 2 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ This option takes an array of strings and/or regular expressions. SDKs should on
52
52
53
53
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.
54
54
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.
56
56
57
57
#### Example
58
58
@@ -154,8 +154,7 @@ tree as well as the unit of reporting to Sentry.
154
154
-`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
155
155
- 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.
156
156
-`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.
159
158
160
159
-`Transaction` Interface
161
160
@@ -165,7 +164,6 @@ tree as well as the unit of reporting to Sentry.
165
164
- Since a `Transaction` inherits a `Span` it has all functions available and can be interacted with like it was a `Span`
166
165
- 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.
167
166
-`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
169
167
-`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.
170
168
171
169
-`Span.finish()`
@@ -302,18 +300,6 @@ Besides the [usual reasons to use \*defer](https://github.com/apache/incubator-z
302
300
303
301
Which in reality is useful for proxies to set it to `0` and opt out of tracing.
304
302
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
-
317
303
## Static API Changes
318
304
319
305
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