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
Consider using new URL syntax in Django 2.0 as transaction name #86
Comments
i'd say url paths. the benefits of using views are valid, but that is an inconvenience you have also when coding in django, it always take a couple of greps to go from view to path and viceversa anyways. actually putting the view in the context is a great idea |
argh, they don't store the actual route name anywhere, so I can't get it :( Guess I need to open a Django PR.... |
Opened an Issue/PR for this: https://code.djangoproject.com/ticket/28766 |
Here is the patch by the way, for future reference: django/django#9323 (got closed unfortunately) |
it moved to here(django/django#10657) and got merged |
Hi all, is there any way to bring the same or similar functionality also to Django 1.11.20? Briefly, my situation is:
Would be great if the transaction name will be either Thanks |
@Giaco9 unfortunately, previous to Django 2.2, this information isn't exposed by Django, so we could only get to it with pretty gnarly monkey patching, which in my opinion isn't worth the benefit. For Django Rest Framework viewsets specifically, I wrote a workaround that includes the |
Thank you @beniwohli, so I just need to make all of my ViewSets inherit from the one you posted and will work 👍 Thank you again |
Since the Opbeat days, we use the view name as the transaction name for Django, while in Flask we use the parametrized URL. The main reason for this was that Django used unwieldy regex in its URLs, which would make the transaction names somewhat ugly.
In Django 2.0, a new way for defining URLs was added and made the default, URL paths. These quite closely mirror Flask.
As such, it might be interesting to use these paths as transaction name for Django to align both Flask and Django.
Benefits of using view name
Benefits of using path name
The text was updated successfully, but these errors were encountered: