Closed
Description
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
- as a user, it's easier to find the actual code if you don't have to look up the view in your URLs first (and Django URL patterns tend to be deeply nested, making it even more difficult to look up the view name). This could be alleviated somewhat by putting the view name in the context or using it as a tag
- less "weird" characters in the transaction name
Benefits of using path name
- aligned with Flask and AFAIK, Node
- multiple paths can point to the same view (or view class). Using the path would keep them separate. This is especially true for e.g. Django Rest Framework or tastypie. If a) we used paths and b) those frameworks would use paths instead of regexes, we wouldn't need to do any magic like https://gist.github.com/beniwohli/b494bd4b368ea4095dad3b629333ae58