Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/platforms/dotnet/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,30 @@ This parameter controls whether integrations should capture HTTP request bodies.

</PlatformSection>

<PlatformSection supported={["dotnet.aspnetcore"]}>

<SdkOption name="TransactionNameProvider" type="function">

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 <PlatformIdentifier name="PreferTransactionNameProvider" />.

</SdkOption>

<SdkOption name="PreferTransactionNameProvider" type="bool" defaultValue="false" availableSince="6.7.0">

Controls when <PlatformIdentifier name="TransactionNameProvider" /> 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).

</SdkOption>

</PlatformSection>

<PlatformSection supported={["dotnet.xamarin", "dotnet.maui"]}>

<SdkOption name="AttachScreenshot" type="bool" defaultValue="false">
Expand Down
Loading