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.
Split from #1024.
Add tracing association behavior in
sentry-coreso emitted metrics include tracing identifiers from the current execution context, aligned with tracing association. Settrace_idfrom the active span when one exists, otherwise from the propagation context, and setspan_idfrom the active span when one exists. Focus on the relevant metric preparation and scope application code insentry-core/src/client.rs,sentry-core/src/scope/real.rs, andsentry-core/src/scope/noop.rs. Add tests fortrace_idfrom propagation context when no active span exists,trace_idfrom the active span when a span exists, andspan_idfrom 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.