getsentry / sentry-python

The official Python SDK for Sentry.io
https://sentry.io/for/python/
MIT License
1.86k stars 486 forks source link

Add `cache.hit` data to Django spans #2043

Closed antonpirker closed 1 year ago

antonpirker commented 1 year ago

Problem Statement

We want to add information on if a configured cache was hit or missed in Django.

See also https://github.com/getsentry/team-webplatform-meta/issues/60

Solution Brainstorm

There are multiple ways to cache data in Django, we probably have to monkey patch Django in various places:

Maybe just patching the low level cache api will handle all the cases.

AbhiPrasad commented 1 year ago

There's some prior art in https://github.com/tim-schilling/django-debug-toolbar/blob/main/debug_toolbar/panels/cache.py we can look at!

AbhiPrasad commented 1 year ago

@antonpirker mind linking some example transactions that has these values? Screenshots are cool as well 😄