Skip to content

Commit 7619578

Browse files
committed
update step 1 as well
1 parent 49984eb commit 7619578

File tree

1 file changed

+2
-2
lines changed
  • platform-includes/distributed-tracing/custom-instrumentation

1 file changed

+2
-2
lines changed

platform-includes/distributed-tracing/custom-instrumentation/go.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Incoming tracing information has to be extracted and stored in memory for later
1212
Here's an example of how to extract and store incoming tracing information using `sentry.ContinueTrace()`:
1313

1414
```go
15-
hub := sentry.CurrentHub()
15+
ctx := r.Context()
16+
hub := sentry.GetHubFromContext(ctx)
1617
sentry.ContinueTrace(hub, r.Header.Get(sentry.SentryTraceHeader), r.Header.Get(sentry.SentryBaggageHeader)),
1718
```
1819

@@ -27,7 +28,6 @@ For distributed tracing to work, the two headers `sentry-trace` and `baggage`, m
2728
You can generate this tracing information with the Sentry SDK's `hub.GetTraceparent()` and `hub.GetBaggage()` functions. Here's an example using Guzzle:
2829

2930
```go
30-
// get the request context
3131
ctx := r.Context()
3232
hub := sentry.GetHubFromContext(ctx)
3333
req, _ := http.NewRequest("GET", "http://exmaple.com", nil)

0 commit comments

Comments
 (0)