Skip to content

Fix incoming defer sampling decision sentry-trace header#3942

Merged
adinauer merged 11 commits into8.x.xfrom
feat/fix-twp
Dec 2, 2024
Merged

Fix incoming defer sampling decision sentry-trace header#3942
adinauer merged 11 commits into8.x.xfrom
feat/fix-twp

Conversation

@adinauer
Copy link
Copy Markdown
Member

📜 Description

Fix incoming defer sampling decision sentry-trace header
And forward isSampled from propagation context to sentry-trace header when not building tracing info from a span.

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 29, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against f778ca4

samplingDecision = new TracesSamplingDecision(sampled, sampleRate);
} else {
samplingDecision = new TracesSamplingDecision(sampled);
if (parentSampled != null) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now uses null sampling decision instead of false for incoming sentry-trace header with deferred sampling decision. This causes sentry sampler to make a decision instead of assuming false from parent should be copied.

}
}

@Test
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO use @BeforeTest instead of @Before as it looks like it's not resetting between tests in the same test class.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO copy this test over to other samples (e.g. jakarta version of this)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this in a follow up PR

@github-actions
Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 397.19 ms 414.10 ms 16.92 ms
Size 1.65 MiB 2.31 MiB 676.07 KiB

Baseline results on branch: feat/bump-spring-boot-3-4

Startup times

Revision Plain With Sentry Diff
ad1087f 488.02 ms 495.50 ms 7.48 ms

App size

Revision Plain With Sentry Diff
ad1087f 1.65 MiB 2.31 MiB 676.03 KiB

Base automatically changed from feat/bump-spring-boot-3-4 to 8.x.x December 2, 2024 14:02
An error occurred while trying to automatically change base from feat/bump-spring-boot-3-4 to 8.x.x December 2, 2024 14:02
Copy link
Copy Markdown
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants