Skip to content

Add trace metric tracing association in sentry-core #1058

@szokeasaurusrex

Description

@szokeasaurusrex

Split from #1024.

Add tracing association behavior in sentry-core so emitted metrics include tracing identifiers from the current execution context, aligned with tracing association. Set trace_id from the active span when one exists, otherwise from the propagation context, and set span_id from the active span when one exists. Focus on the relevant metric preparation and scope application code in sentry-core/src/client.rs, sentry-core/src/scope/real.rs, and sentry-core/src/scope/noop.rs. Add tests for trace_id from propagation context when no active span exists, trace_id from the active span when a span exists, and span_id from the active span when a span exists. Do not include default attribute enrichment, user attribute enrichment, or callback processing in this issue.

If code is reused from #997, include Co-authored-by: Joris Bayer <joris.bayer@sentry.io> in commit trailers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions