getsentry / getsentry/sentry-dotnet

Document StartOrContinueTrace (vs StartTransaction)

Open
#3,838 3 comments 0 reactions 0 assignees View on GitHub
.NET Docs
Dominant language
C#
Stars
770
Forks
248
Avg merge
3d 4h
Merged PRs (30d)
49

Description

_Originally posted by @jamescrosswell in [#3836](https://github.com/getsentry/sentry-dotnet/issues/3836#issuecomment-2531149647)_

The SDK includes a `StartOrContinueTrace` method that returns a transaction context but doesn't use that context to start a new transaction...

https://github.com/getsentry/sentry-dotnet/blob/3e70c3126515c87b1851b6a9a7afd99ffbb9aeb7/src/Sentry.AspNet/HttpContextExtensions.cs#L60-L130

Under the hood, this propagates trace headers even when performance is disabled:
https://github.com/getsentry/sentry-dotnet/blob/3fde00a69fae336e7d369a80ecd3bbc01e7b1d2d/src/Sentry/Internal/Hub.cs#L252-L253

Later this information gets used when forming headers for outbound requests:
https://github.com/getsentry/sentry-dotnet/blob/3fde00a69fae336e7d369a80ecd3bbc01e7b1d2d/src/Sentry/Internal/Hub.cs#L200-L211

That intent should be clearly documented in the summary for the `StartOrContinueTrace` method.

## References

- https://github.com/getsentry/sentry-dotnet/pull/2493
- https://github.com/getsentry/sentry-dotnet/issues/3838#issuecomment-2537204715

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.