diff --git a/docs/platforms/dotnet/common/configuration/options.mdx b/docs/platforms/dotnet/common/configuration/options.mdx index bc41dfdaf5065..2bfc264054364 100644 --- a/docs/platforms/dotnet/common/configuration/options.mdx +++ b/docs/platforms/dotnet/common/configuration/options.mdx @@ -206,6 +206,30 @@ This parameter controls whether integrations should capture HTTP request bodies. + + + + +A callback used to name transactions for requests that the routing system doesn't resolve to a route template (for example, requests that don't match any endpoint). It receives the current `HttpContext` and returns the route portion of the name; Sentry prepends the uppercased HTTP method, so returning `orders/list` produces a transaction named `GET orders/list`. Return `null` or `string.Empty` to fall back to the URL path. + +```csharp +options.TransactionNameProvider = context => context.Request.Path; +``` + +By default the provider is only invoked as a fallback for unresolved routes. To have it run on every request, enable . + + + + + +Controls when is invoked. + +When `false` (the default), the provider only runs as a fallback for requests whose route can't be resolved to a template. When `true`, the provider runs on every request after routing, and a non-empty return value overrides the route-derived transaction name. If the provider returns `null` or `string.Empty`, the routed name is kept (or the URL-path fallback applies when no route was resolved). + + + + +