-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(.NET): ASP.NET transaction namesource (#7866)
- Loading branch information
1 parent
a5bd9ca
commit f20bb75
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: Troubleshooting | ||
sidebar_order: 100 | ||
description: "Learn more about how to troubleshoot performance issues with the ASP.NET SDK." | ||
--- | ||
|
||
## Transactions get grouped together as `GET /*/*.` | ||
|
||
The SDK creates the transaction name as follows | ||
|
||
```csharp | ||
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: | ||
|
||
```csharp | ||
if (SentrySdk.GetSpan()?.GetTransaction() is TransactionTracer transactionTracer) | ||
{ | ||
transactionTracer.NameSource = TransactionNameSource.Custom; | ||
transactionTracer.Name = "GET /users/{id}"; | ||
} | ||
|
||
``` |
f20bb75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sentry-docs – ./
sentry-docs-git-master.sentry.dev
sentry-docs.sentry.dev
docs.sentry.io