Custom Instrumentation
To capture transactions and spans customized to your organization's needs, you must first set up performance monitoring.
In cases where you want to attach Spans to an already ongoing Transaction you can use SentrySdk.GetSpan()
. If there is a running Transaction or Span currently on the scope, this method will return a SentryTransaction
or Span
; otherwise, it returns null
.
Copied
using Sentry;
var span = SentrySdk.GetSpan();
if (span == null)
{
span = SentrySdk.StartTransaction("task", "op");
}
else
{
span = span.StartChild("subtask");
}
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
- Package:
- upm:sentry-unity
- Version:
- 2.0.4
- Repository:
- https://github.com/getsentry/sentry-unity