Suwayomi / Suwayomi-Server

A rewrite of Tachiyomi for the Desktop
Mozilla Public License 2.0
4.23k stars 208 forks source link

[Feature Request] Prometheus metrics endpoint #934

Open sbordeyne opened 7 months ago

sbordeyne commented 7 months ago

What feature should be added to Suwayomi?

A simple prometheus metrics endpoint on the server. It could export metrics such as :

Those are the metrics I thought about right now (that would solve most of my monitoring issues), but more may be available/easily exported, the more metrics, the better after all. I did not detail all of the labels, but a good base would be to have cardinality based on:

Why/Project's Benefit/Existing Problem

I've set up a monitoring stack on my homelab, and I'd like metrics to be exported for all the services that I use, especially downloaders. My observability on tachidesk is pretty much only logs right now, so it's pretty hard to get alerts when a download is stuck, or get cool dashboards to see how many chapters have been downloaded, or if some chapters are out of date.

Robonau commented 7 months ago

A couple of the points u want are really unlikely to happen suwayomi_extension_rate_limited (suwayomi doesn't know what is causing the slow down) suwayomi_extensions_uptime (suwayomi only tries when using the extension) suwayomi_extension_download_speed (this would only function when downloading from the extension at that moment)

Assuming you are using grafana to visualise your Prometheus data you can do some of what you want using the GraphQL Data Source suwayomi_download_queue_size (if the data source allows subscriptions idk if it does, if not then i dont think adding a static query to get download subscription data would be a big deal) suwayomi_downloaded_chapters_count suwayomi_missing_chapters

suwayomi_chapters_size_bytes is really the only one that is reasonable but not possible through graphql it would probably be easier to just add a graphql endpoint for chapters size