milesmcc / shynet

Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.
Apache License 2.0
2.87k stars 180 forks source link

feat: Add Prometheus metrics #301

Closed adinhodovic closed 4 months ago

adinhodovic commented 8 months ago

You can visit localhost/prometheus/metrics to view the metrics. Currently exposes http, db and cache metrics from django-prometheus. U can also use the package to expose custom metrics relevant to shynet, but this is not done in this PR. HTTP metrics are great for insights to the shynet instance status. Dashboards that can be created from this can be previewed with the images in Django-mixin, if you don't have a running Grafana instance.

Maybe it should be behind a flag?

milesmcc commented 4 months ago

Hey! Thanks for the PR — and I'm very sorry for the long delay in my review. Unfortunately I think we're better off not introducing another dependency here; while I can see why Prometheus metrics would be useful, I would prefer not to introduce the complexity of introducing a mixin.