scoutapp / roadmap

The public roadmap for Scout application monitoring.
https://scoutapp.com
16 stars 2 forks source link

Sentry Python Transaction Error Views #47

Open itsderek23 opened 6 years ago

itsderek23 commented 6 years ago

We're able to display Sentry errors for Django apps under the App Overview:

image

...but not under specific endpoints. Sentry appears to name an issue's associated transaction based on the request path:

https://github.com/getsentry/raven-python/blob/e52c837859d4fbeafdd2bdfa7dc6331a953ca77f/raven/contrib/django/client.py#L308

Also:

For example, in Django, if you’re processing a web request when an error is hit, the transaction name becomes a normalized version of the route pattern.

We name our web endpoints based on the Django view name (ie /hello.views.posts).

This is different than Sentry's Rails conventions.

One option: provide an an additional integration step for Sentry, instructing the user to add a custom tag w/key=django_view and the name = the view name.

Note I haven't tested Flask yet.

itsderek23 commented 6 years ago

Note I haven't tested Flask yet.

The naming logic for Flask looks the same:

image

Our endpoints are named app.routes.boom, so the same approach would apply for Flask.

adamchainz commented 5 years ago

For all the Python integrations we do tag with the request path already ( e.g. https://github.com/scoutapp/scout_apm_python/blob/c5fb9f2b26cad3c3ec40970b0dfc3c0bc566be64/src/scout_apm/django/middleware.py#L18 / https://github.com/scoutapp/scout_apm_python/blob/c5fb9f2b26cad3c3ec40970b0dfc3c0bc566be64/src/scout_apm/flask/__init__.py#L66 ) so maybe that's of use?