Skip to content

Automatic trace propagation in outgoing HTTP requests #1445

@rhcarvalho

Description

@rhcarvalho

Describe the idea

Automatically create spans for outgoing requests and propagate the trace header sentry-trace with information on the current span (the one that was just created for the request).

Also include update in the tracing examples (see #1444 (comment)).

See also getsentry/develop#254

Why do you think it's beneficial to most of the users

Trace propagation is critical to have traces that connect services together as one coherent unit.
Without this, either services will create disconnected traces for the same request/operation and/or different sampling decisions will lead to fragmented trace data in Sentry.
Users shouldn't need to do manual propagation when we can instrument libraries automatically.

Possible implementation

Python: https://github.com/getsentry/sentry-python/blob/51987c57157102bbd32e1e7b084c26f4dc475d86/sentry_sdk/integrations/stdlib.py#L57-L112

JS Node: https://github.com/getsentry/sentry-javascript/blob/f7fc73313cb1f602dfbde856e116bb74f39dde81/packages/node/src/integrations/http.ts#L109-L123

JS Browser: https://github.com/getsentry/sentry-javascript/blob/13eea94a4da4334dd79f829a2657c03dbb50f780/packages/tracing/src/browser/request.ts#L87-L264

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions