Troubleshooting
Learn more about how to troubleshoot performance issues with the ASP.NET SDK.
The SDK creates the transaction name as follows
Copied
var method = httpContext.Request.HttpMethod;
var path = httpContext.Request.Path;
var transactionName = $"{method} {path}";
// Since the name is derived from the path and potentially contains identifiers it is marked as such
transactionContext.NameSource = TransactionNameSource.Url;
Since the URL
might contain potential identifiers, such as GET /users/123
, the backend tries to remove values with high variations. Leading it to GET /users/*
. Sometimes, when there are many paths, it can result in GET /*/*
. It is possible to work around this and still rely on automatic performance instrumentation. You can access the currently active transaction and overwrite the Name
and NameSource
. Specifying the exact name of the transaction, without any variables. Using the example above, it would look like:
Copied
if (SentrySdk.GetSpan()?.GetTransaction() is TransactionTracer transactionTracer)
{
transactionTracer.NameSource = TransactionNameSource.Custom;
transactionTracer.Name = "GET /users/{id}";
}
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").