Ensure the SDK can propagate traces from non-HTTP boundaries

Open
#5,571 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
csharp

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.

Description

.NET Feature Traces

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

Dominant language
C#
Stars
775
Forks
262
Avg merge
1d 16h
Merged PRs (30d)
118

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-dotnet

All issues in getsentry/sentry-dotnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.