Skip to content

Trace Context & traceparent adherence for easier distributed tracing adoption #64520

@dillonstreator

Description

@dillonstreator

Problem Statement

Enabling distributed tracing with Sentry is currently not as frictionless as it could be. Specifically, lack of strict adherence to the traceparent spec in some cases requires extra steps and in others, such as when external systems require strict traceparent adherence, does not allow tracing.

https://github.com/getsentry/sentry-javascript/blob/84baeb1847b0cd90af43ba8b29517b1b6cb24854/packages/core/src/tracing/span.ts#L539-L547
https://github.com/getsentry/sentry-javascript/blob/84baeb1847b0cd90af43ba8b29517b1b6cb24854/packages/core/src/utils/spanUtils.ts#L28-L36
https://github.com/getsentry/sentry-javascript/blob/84baeb1847b0cd90af43ba8b29517b1b6cb24854/packages/utils/src/tracing.ts#L117-L130
https://github.com/getsentry/sentry-python/blob/ad86d619db0d6f742d6b5abddbc466bf64d5cd93/sentry_sdk/scope.py#L279-L302

Solution Brainstorm

  • Update the internal Sentry API server to look for a traceparent header and fallback to Sentry-Trace
  • Update client SDKs and SDK integrations that hook into external requests to send a traceparent header alongside the Sentry-Trace header with strict adherence to the format described in the spec https://www.w3.org/TR/trace-context/#traceparent-header
    • /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2})?$/

Product Area

Other

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions