Open
Conversation
3 tasks
Based on getsentry/sentry-javascript#18572 (comment): - Add second gRPC microservice (villain) on separate port (5002) - Use `inheritAppConfig: false` on both connectMicroservice calls - Add `loader: { defaults: true }` to gRPC options - Register traceExporter both as top-level and in BatchSpanProcessor (duplicating reporter's setup) - Add `/test-cross-service` endpoint for cross-service call patterns - Increase test client concurrency with ramping waves up to 100 concurrent requests Agent transcript: https://claudescope.sentry.dev/share/p0PKCnaM4X-PXwNqNurK_NZcF-DFYk6cfB8x4CcIfYY
…SpanExporter Replaces verbose per-span logging with capped ORPHAN/PARENTED counters (10 each) to make output readable. Removes ConsoleSpanExporter that was flooding logs. Result: 100% of spans are orphaned, confirming the context propagation bug is fully reproduced. Agent transcript: https://claudescope.sentry.dev/share/6Z9fxEpUGfJ4PxxU4WoJbZPSQ9Y5tZsy86c4WwRQkjc
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Reproduction for getsentry/sentry-javascript#18572
OpenTelemetry context not propagating correctly when using
@sentry/nestjswith custom OTel setup (skipOpenTelemetrySetup: true) andSentryContextManager. Traces randomly break into multiple partial traces under load, especially with gRPC endpoints.Reproduction result
100% of spans are orphaned — zero correctly-parented spans. The
SentryContextManagercompletely loses context propagation under concurrent gRPC traffic across multiple microservices.Setup (matches reporter's production config)
SentryContextManager,SentryPropagator,SentrySpanProcessorskipOpenTelemetrySetup: truewith manual OTel configurationwrapSamplingDecision(health-check filter)connectMicroservice()withinheritAppConfig: falsetraceExporter+ insideBatchSpanProcessor)loader: { defaults: true }in gRPC optionsContextDebugSpanProcessorthat logs ORPHAN vs PARENTED spans (capped at 10 each)How to run
Check server logs for
[CONTEXT-DEBUG]lines — you'll see only ORPHAN entries and zero PARENTED entries.Key findings
/test-cross-serviceendpoint (concurrent calls to both hero and villain gRPC services) is the most realistic triggerNotes
tracesSampleRate/SentrySpanProcessordoes not