getsentry / getsentry/sentry-dotnet
Ensure the SDK can propagate traces from non-HTTP boundaries
- Dominant language
- C#
- Stars
- 770
- Forks
- 248
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 51
Description
> `SentrySdk.ContinueTrace(traceHeader, baggageHeader)` followed by `SentrySdk.StartTransaction(context)` is the documented way to continue a distributed trace from a non-HTTP boundary (#2646).
I'm not sure that's true... that PR was closed - never merged.
To be honest, I'm not sure if we have an explicit way to continue traces from a non-HTTP boundary. The `ContinueTrace` method stores trace information in the propagation context which, so far, is only really used to apply trace information to events when tracing is disabled - e.g. here:
https://github.com/getsentry/sentry-dotnet/blob/9683c36fcb12e156fcf797128277b00f3c4fe7b7/src/Sentry/Internal/Hub.cs#L677-L678
Propagating from non-HTTP boundaries should be possible but it requires a bit of investigation/planning. I won't have time for this immediately as we need to get the SDK ready for .NET 11. I also don't have time to review any moderately complex PRs at the moment.
I'll create an issue for this so that we can priorities and schedule in the work once the work for .NET 11 is complete.
_Originally posted by @jamescrosswell in https://github.com/getsentry/sentry-dotnet/issues/5569#issuecomment-5656623452_
Contributor guide
Research direction
Start by reading SentrySdk.ContinueTrace and SentrySdk.StartTransaction, then inspect the propagation-context handling in src/Sentry/Internal/Hub.cs around lines 677-678. Determine how non-HTTP trace propagation is currently expected to work and what supported API behavior is missing. Done should include a clear, reviewed approach for continuing distributed traces across non-HTTP boundaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- distributed-systems, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100