question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`SentrySdk.GetSpan` always returns null

See original GitHub issue

Which 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:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelmaireggercommented, May 13, 2021

@bruno-garcia Ok, thanks I will try that.

Yes, I am useing the SDK for Xamarin.Form and the one for WPF

0reactions
lucas-zimermancommented, Oct 6, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found