korfuri / django-prometheus

Export Django monitoring metrics for Prometheus.io
Apache License 2.0
1.44k stars 244 forks source link

Support Django's official Redis cache backend. #409

Closed Yaser-Amiri closed 9 months ago

Yaser-Amiri commented 1 year ago

Django added Redis cache backend since 4.0. I added the backend but I thinks maybe there is better way for naming! Now the old django_redis backend is called RedisCache (I left it intact for backward compatibility) and I named the new one NativeRedisCache.

If you thinks there is better option for naming or anything else, just let me know.

Thanks

agershman commented 1 year ago

Can we get this merged in? The django-prometheus guidance on instrumenting the Redis cache backend are otherwise a non-starter for folks using newer versions of Django.

julianwachholz commented 7 months ago

This still requires django_redis to be installed, could the import be wrapped in a try/except clause as well? Better yet, maybe the two backends should be split into separate modules.