-
-
Notifications
You must be signed in to change notification settings - Fork 468
feat: Add strict trace continuation support #5136
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
dc8d319
feat: Add strict trace continuation support
giortzisg e550ae3
Format code
getsentry-bot c272ee4
Add changelog entry
giortzisg 1cfc2ea
Update API surface file for strict trace continuation
giortzisg 108eb2d
Address review comments for strict trace continuation
giortzisg e30064c
Fix compilation errors after rebase on main
giortzisg 4545735
fix: Move changelog entry to Unreleased section
giortzisg 61ada6a
Format code
getsentry-bot 519f6a6
fix: Address review comments — pass options to PropagationContext, fi…
giortzisg 360fc94
fix: Add missing 8.34.1 changelog section
giortzisg ea9f456
merge: Resolve changelog conflict with main
giortzisg 58bfc8e
Format code
getsentry-bot ebe8c4c
fix: Address PR review comments for strict trace continuation
giortzisg 824b30b
Format code
getsentry-bot e2fdc46
fix(tracing): Clarify strict org validation debug log
adinauer d3b073d
fix(android): Use enabled suffix for strict trace manifest key
adinauer f7fef22
fix(api): Mark effective org ID helper as internal
adinauer 71562fa
ref(tracing): Extract trace continuation decision into TracingUtils
adinauer 327d897
fix(opentelemetry): Enforce strict continuation in propagators
adinauer f1edc98
Merge branch 'main' into feat/strict-trace-continuation
adinauer 863f05b
Format code
getsentry-bot 1d8e301
fix(tracing): Fix empty orgId bypassing DSN fallback
adinauer 25e71db
Merge branch 'main' into feat/strict-trace-continuation
adinauer a3c86e7
Format code
getsentry-bot 3d1d119
ref: Remove redundant trim of already-trimmed effective org ID
adinauer bad469f
Merge branch 'main' into feat/strict-trace-continuation
adinauer cf7d9fe
ref(tracing): Revert shouldContinueTrace check in OtelSentrySpanProce…
adinauer 435d2e7
fix(test): Clean up global Sentry state in SentryPropagatorTest
adinauer 63222e5
fix(test): Use mock scopes in propagator strict continuation tests
adinauer a4cd81a
fix(test): Reset OTel context in propagator test teardown
adinauer f029100
Merge branch 'main' into feat/strict-trace-continuation
adinauer 070ee32
fix(test): Add back test for inject with invalid span
adinauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
sentry-opentelemetry/sentry-opentelemetry-core/src/test/kotlin/SentryPropagatorTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package io.sentry.opentelemetry | ||
|
|
||
| import io.opentelemetry.api.trace.Span | ||
| import io.opentelemetry.context.Context | ||
| import io.sentry.Sentry | ||
| import io.sentry.opentelemetry.SentryOtelKeys.SENTRY_BAGGAGE_KEY | ||
| import io.sentry.opentelemetry.SentryOtelKeys.SENTRY_TRACE_KEY | ||
| import kotlin.test.AfterTest | ||
| import kotlin.test.BeforeTest | ||
| import kotlin.test.Test | ||
| import kotlin.test.assertFalse | ||
| import kotlin.test.assertNull | ||
|
|
||
| class SentryPropagatorTest { | ||
|
|
||
| @BeforeTest | ||
| fun setup() { | ||
| Sentry.init("https://key@sentry.io/proj") | ||
| } | ||
|
|
||
| @AfterTest | ||
| fun teardown() { | ||
| Sentry.close() | ||
| Context.root().makeCurrent() | ||
| } | ||
|
|
||
| @Suppress("DEPRECATION") | ||
| @Test | ||
| fun `ignores incoming headers when strict continuation rejects org id`() { | ||
| Sentry.init { options -> | ||
| options.dsn = "https://key@o2.ingest.sentry.io/123" | ||
| options.isStrictTraceContinuation = true | ||
| } | ||
|
|
||
| val propagator = SentryPropagator() | ||
| val carrier: Map<String, String> = | ||
| mapOf( | ||
| "sentry-trace" to "f9118105af4a2d42b4124532cd1065ff-424cffc8f94feeee-1", | ||
| "baggage" to "sentry-trace_id=f9118105af4a2d42b4124532cd1065ff,sentry-org_id=1", | ||
| ) | ||
|
|
||
| val newContext = propagator.extract(Context.root(), carrier, MapGetter()) | ||
|
|
||
| assertFalse(Span.fromContext(newContext).spanContext.isValid) | ||
| assertNull(newContext.get(SENTRY_TRACE_KEY)) | ||
| assertNull(newContext.get(SENTRY_BAGGAGE_KEY)) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.