sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

Transactions from rest_framework.routers seem to be missing

Open sl0thentr0py opened this issue 1 year ago • 2 comments

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.3.1

Steps to Reproduce

from discord

from rest_framework import routers
...
router.register(r"current-user", user_views.CurrentUserViewSet, basename="current-user")
urlpatterns = [
    path("admin/", admin.site.urls),
    path("", include(router.urls)), # THIS ENDPOINTS DOESNT WORK FOR PROFILING
    path("o/", include("oauth2_provider.urls", namespace="oauth2_provider")),
    path("accounts/", include("app.user.urls")), # THIS ENDPOINT WORK FOR PROFILING
]

Expected Result

transactions and profiles are visible

Actual Result

they're not visible (or probably grouped under a different generic route if transaction name resolving is not working)

sl0thentr0py avatar May 31 '24 15:05 sl0thentr0py

Any update on this?

quememo avatar Jun 17 '24 14:06 quememo

Not yet @quememo, sorry!

sentrivana avatar Jun 19 '24 14:06 sentrivana

Hey @quememo (and whoever else has the same issue), I've tried to reproduce this and failed.

Here's my root urls.py, I've just followed the tutorial at https://www.django-rest-framework.org/tutorial/quickstart/#urls to set things up and tried accessing /users.

from django.contrib import admin
from django.urls import include, path
from rest_framework import routers
from quickstart import views

router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    path("", include(router.urls)),  # this shouldn't work but it does
]

Here's the profile:

Image

The transactions are also correctly grouped under /users. There are some generic WSGI request transactions as well, but they're just for fetching static assets.

It'd help greatly if someone could come up with a small complete example including sentry_sdk.init -- I can't repro this from the original example.

sentrivana avatar Mar 18 '25 11:03 sentrivana

Closing since we cannot reproduce per @sentrivana's comment above. If anyone encounters this issue and would like to provide a reproduction, please reopen this issue or open a new issue referencing this one. Thanks!

szokeasaurusrex avatar Mar 28 '25 09:03 szokeasaurusrex