From f29c623d559fa44ba1eec99968b281db8f24e3c1 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 18 Sep 2023 21:03:29 +0200 Subject: [PATCH 1/6] added troubleshooting for asp.net performance --- .../aspnet/performance/troubleshooting.mdx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx 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..02d42600c7b603 --- /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 these transactions have their name stripped. +It is possible to work around this and still rely on automatic performance instrumentation you can access the transaction and set the `Name` and `NameSource` yourself. + +```csharp +if (SentrySdk.GetSpan()?.GetTransaction() is TransactionTracer transactionTracer) +{ + transactionTracer.NameSource = TransactionNameSource.Custom; + transactionTracer.Name = "my_transaction_name"; +} + +``` From 305ce7a9fe0bd8a3e0b5309aeb33a25f068883aa Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 18 Sep 2023 21:04:08 +0200 Subject: [PATCH 2/6] fix --- .../dotnet/guides/aspnet/performance/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx index 02d42600c7b603..936f50666b37d6 100644 --- a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx +++ b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx @@ -19,7 +19,7 @@ transactionContext.NameSource = TransactionNameSource.Url; ``` Since the `URL` might contain potential identifiers these transactions have their name stripped. -It is possible to work around this and still rely on automatic performance instrumentation you can access the transaction and set the `Name` and `NameSource` yourself. +It is possible to work around this and still rely on automatic performance instrumentation. You can access the currently active transaction and set the `Name` and `NameSource` yourself. ```csharp if (SentrySdk.GetSpan()?.GetTransaction() is TransactionTracer transactionTracer) From 206e7b3c8d47c7820d7479b0268ad8aa408228d4 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 18 Sep 2023 21:04:31 +0200 Subject: [PATCH 3/6] wip --- .../dotnet/guides/aspnet/performance/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx index 936f50666b37d6..a93ddc5b68560c 100644 --- a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx +++ b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx @@ -19,7 +19,7 @@ transactionContext.NameSource = TransactionNameSource.Url; ``` Since the `URL` might contain potential identifiers these transactions have their name stripped. -It is possible to work around this and still rely on automatic performance instrumentation. You can access the currently active transaction and set the `Name` and `NameSource` yourself. +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`. ```csharp if (SentrySdk.GetSpan()?.GetTransaction() is TransactionTracer transactionTracer) From 2a59d8cfa2e9c287de2a7d3ff7a8089a4da8bbb5 Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Mon, 18 Sep 2023 22:00:27 +0200 Subject: [PATCH 4/6] Update src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx Co-authored-by: Bruno Garcia --- .../dotnet/guides/aspnet/performance/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx index a93ddc5b68560c..d070d4d670e41d 100644 --- a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx +++ b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx @@ -18,7 +18,7 @@ var transactionName = $"{method} {path}"; transactionContext.NameSource = TransactionNameSource.Url; ``` -Since the `URL` might contain potential identifiers these transactions have their name stripped. +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`. ```csharp From 37435ed6b99804d1d10c0e865a9e3541c74bcf9b Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Mon, 18 Sep 2023 22:00:36 +0200 Subject: [PATCH 5/6] Update src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx Co-authored-by: Bruno Garcia --- .../dotnet/guides/aspnet/performance/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx index d070d4d670e41d..35120f03408039 100644 --- a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx +++ b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx @@ -25,7 +25,7 @@ It is possible to work around this and still rely on automatic performance instr if (SentrySdk.GetSpan()?.GetTransaction() is TransactionTracer transactionTracer) { transactionTracer.NameSource = TransactionNameSource.Custom; - transactionTracer.Name = "my_transaction_name"; + transactionTracer.Name = "GET /users/{id}"; } ``` From d8befb93dac68d126dc93ad01f78bd6d796c8800 Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Mon, 18 Sep 2023 22:00:53 +0200 Subject: [PATCH 6/6] Update src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx Co-authored-by: Bruno Garcia --- .../dotnet/guides/aspnet/performance/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx index 35120f03408039..44681c186bbce3 100644 --- a/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx +++ b/src/platforms/dotnet/guides/aspnet/performance/troubleshooting.mdx @@ -19,7 +19,7 @@ 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`. +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)