Skip to content

Commit 091eacd

Browse files
committed
Add trace propagation
1 parent 24ab5ca commit 091eacd

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

develop-docs/sdk/telemetry/spans/span-properties.mdx

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Span Trace Propagation
3+
---
4+
5+
# Span Trace Propagation
6+
7+
## Continue an incoming trace
8+
9+
To continue a trace from an upstream service, the SDK must expose a method to extract the traceparent and baggage information and apply these to the applicable scope.
10+
11+
```js
12+
scope.setPropagationContext({
13+
traceparent: request.headers.SENTRY_TRACE,
14+
baggage: request.headers.SENTRY_BAGGAGE,
15+
})
16+
```
17+
Newly created root spans should now contain these properties, such as `trace_id` and `parent_span_id`.
18+
19+
## Continue an outgoing trace
20+
21+
To propagate a trace to a downstream service, the SDK must expose methods to fetch the required information to allow the next service to continue the trace.
22+
23+
```js
24+
traceparent = scope.getTraceparent()
25+
baggage = scope.getBaggage()
26+
```

0 commit comments

Comments
 (0)