getsentry / team-sdks

A meta repository for tracking work across all SDK teams.
0 stars 0 forks source link

Chore: Disable tracing for generic redirects in web frameworks #48

Open jjbayer opened 5 months ago

jjbayer commented 5 months ago

As discussed in Client Infra TSC:

We noticed that our own Django project appends a trailing slash to any route, even if the route is unknown, and that the Django integration creates a transaction for such requests with a "transaction" set to the raw URL path. This leads to noise in the product and high cardinality in our transaction metrics storage:

image

Similar to generic 404s, we should not create a transaction for this type of generic redirect in any web framework, at least not by default. If we want to offer the user an opt-in for these transactions, we should name them "transaction": "redirect" or similar to reduce noise.

Note that this is not about all redirects (e.g. custom endpoints that run business logic before responding with 301), but rather about generic redirects that are cheap for the server, e.g. URL normalization (like appending a trailing slash).

### Tasks
- [ ] Fix for Django (python).
- [ ] Align behavior of other web frameworks.