Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry.AspNetCore contains an extra slash in transaction name for /healthz when a base path is used #2256

Closed
SeanFeldman opened this issue Mar 27, 2023 · 1 comment · Fixed by #2265
Assignees
Labels
ASP.NET Core Bug Something isn't working

Comments

@SeanFeldman
Copy link
Contributor

SeanFeldman commented Mar 27, 2023

.NET 6.0.0
Sentry.AspNetCore 3.29.1

Steps to Reproduce

Using the code outlined in #1435 (comment), throw an exception in the health endpoint.

Expected Result

Transaction named GET api/healthz

Actual Result

Transaction named GET api//healthz (double slash)

@SeanFeldman
Copy link
Contributor Author

The issue is likely caused by how the transaction name is built when there's a base path present in the HttpContextExtensions.NewRouteFormat extension method at

builder.Append(context.Request.PathBase.Value?.TrimStart('/'))
.

When the route is added, it assumes the route doesn't start with a leading slash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASP.NET Core Bug Something isn't working
Projects
Archived in project
2 participants