sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Add SentrySdk.StartChild

Open jamescrosswell opened this issue 1 year ago • 1 comments

The code to create a span on the current transaction is currently quite verbose:

var span = SentrySdk.GetSpan();

if (span == null)
{
    span = SentrySdk.StartTransaction("name", "op");
}
else
{
    span = span.StartChild("op");
}

It would be nice if all of that was wrapped/implied in a SentrySdk.StartChild method (those 9 lines of code could be shrunk down to 1).

jamescrosswell avatar Feb 21 '24 23:02 jamescrosswell

funny, i've actually filed an issue related to this today, although it's not strictly a duplicate #3165

vaind avatar Feb 22 '24 18:02 vaind