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

Fix incoming defer sampling decision sentry-trace header #3942

Merged
merged 11 commits into from
Dec 2, 2024
Merged

Conversation

adinauer
Copy link
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

Copy link
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
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.

@@ -44,4 +44,70 @@ class PersonSystemTest {
testHelper.doesTransactionContainSpanWithOp(transaction, "spanCreatedThroughSentryApi")
}
}

@Test
Copy link
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
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
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

Copy link
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
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 👍

@adinauer adinauer merged commit 254461b into 8.x.x Dec 2, 2024
32 of 34 checks passed
@adinauer adinauer deleted the feat/fix-twp branch December 2, 2024 14:17
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