diff --git a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx new file mode 100644 index 00000000000000..44681c186bbce3 --- /dev/null +++ b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx @@ -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}"; +} + +```