Skip to content

Commit

Permalink
feat: Include trace origin in auto spans (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish authored Jun 4, 2024
1 parent 0fcb64e commit e21fdc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/integrations/net-breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
getDynamicSamplingContextFromClient,
getDynamicSamplingContextFromSpan,
getIsolationScope,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SentryNonRecordingSpan,
setHttpStatus,
spanToTraceHeader,
Expand Down Expand Up @@ -178,6 +179,8 @@ function createWrappedRequestFactory(
})
: new SentryNonRecordingSpan();

span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.http.electron.net');

if (shouldAttachTraceData(method, url)) {
const { traceId, spanId, sampled, dsc } = {
...getIsolationScope().getPropagationContext(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{
"op": "http.client",
"trace_id": "{{id}}",
"origin": "auto.http.electron.net",
"parent_span_id": "{{id}}",
"span_id": "{{id}}",
"start_timestamp": 0,
Expand Down

0 comments on commit e21fdc5

Please sign in to comment.