Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject meta tags in Tracing-without-Performance-mode #8520

Closed
7 tasks done
Tracked by #8352
AbhiPrasad opened this issue Jul 12, 2023 · 5 comments
Closed
7 tasks done
Tracked by #8352

Inject meta tags in Tracing-without-Performance-mode #8520

AbhiPrasad opened this issue Jul 12, 2023 · 5 comments

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Jul 12, 2023

Extracted from #8352 as standalone task. Make sure tracing without performance works for injecting meta tags.

We should gate this with a new boolean option.

Tasks

  1. Lms24
  2. Lms24
  3. Package: sveltekit
    Lms24
  4. lforst
@lforst
Copy link
Member

lforst commented Nov 9, 2023

@AbhiPrasad What exactly needs to be done here? I would like to do this for Next.js but don't fully understand the task.

@AbhiPrasad
Copy link
Member Author

Right now we only inject meta tags if there is a sampled transaction/span. It would be great if we can remove this condition and inject meta tags based on the propagation context.

Same conditional logic like we have for undici:

if (span) {
const dynamicSamplingContext = span?.transaction?.getDynamicSamplingContext();
const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
setHeadersOnRequest(request, span.toTraceparent(), sentryBaggageHeader);
} else {
const { traceId, sampled, dsc } = scope.getPropagationContext();
const sentryTrace = generateSentryTraceHeader(traceId, undefined, sampled);
const dynamicSamplingContext = dsc || getDynamicSamplingContextFromClient(traceId, client, scope);
const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
setHeadersOnRequest(request, sentryTrace, sentryBaggageHeader);

@lforst
Copy link
Member

lforst commented Nov 9, 2023

Got it. Thanks!

@lforst
Copy link
Member

lforst commented Nov 14, 2023

@AbhiPrasad I wonder if this will screw with the trace view in replays a lot. This would essentially cause browser sessions of multiple different users to be grouped together under one server process 🤔 Maybe this is not what we want at all...

@Lms24 Lms24 changed the title Use propagation context when injecting meta tags Inject meta tags in Tracing-without-Performance-mode Jul 30, 2024
@s1gr1d
Copy link
Member

s1gr1d commented Dec 11, 2024

Closing this because it has been implemented

@s1gr1d s1gr1d closed this as completed Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants