`SentrySdk.GetSpan` always returns null
See original GitHub issueWhich SDK and version?
- WPF .NET5
- Xamarin.Forms netstandard2.0
Steps to Reproduce
var span = SentrySdk.GetSpan() ?? SentrySdk.StartTransaction("tx", "tx");
var span1 = span.StartChild("child");
var span2 = SentrySdk.GetSpan();
Expected Result
Get latest span
Actual Result
span2
is null? Shouldn’t it be equal to span1? Or am I misunderstanding something?
I have tried the same code with a surrounding:
using(var scope = SentrySdk.PushScope())
{
..
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Custom Instrumentation for .NET
GetSpan() . If there is a running Transaction or Span currently on the scope, this method will return a SentryTransaction or Span ;...
Read more >Scope.getSpan() may return a transaction that has already ...
Returns current active Span or Transaction. *. * @return current active Span or Transaction or null if transaction has not been set.
Read more >OpenTelemetry Support - Sentry Developer Documentation
This document details Sentry's work in integrating and supporting OpenTelemetry , the open standard for metrics, traces and logs. In particular, it focuses ......
Read more >How to decipher sentry warning; "span of type Connection ...
It looks like a bug in Sentry SDK. See the related issue. There is hope that this will be fixed soon. The latter...
Read more >sentry/types@7.62.0
Returning null will cause the event to be dropped. Parameter event. The error or message event generated by the SDK. Parameter hint. Event...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bruno-garcia Ok, thanks I will try that.
Yes, I am useing the SDK for Xamarin.Form and the one for WPF
PR for the docs created here: https://github.com/getsentry/sentry-docs/pull/4239