Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Prometheus metrics endpoint #934

Open
sbordeyne opened this issue Apr 19, 2024 · 1 comment
Open

[Feature Request] Prometheus metrics endpoint #934

sbordeyne opened this issue Apr 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sbordeyne
Copy link

What feature should be added to Suwayomi?

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

  • suwayomi_download_queue_size: Gauge (count of the mangas to be downloaded)
  • suwayomi_downloaded_chapters_count: Counter (number of chapters downloaded overall)
  • suwayomi_extensions_uptime: Histogram (to make sure the extensions are up and running, able to connect to their respective backends)
  • suwayomi_missing_chapters: Gauge (with labels like the manga name/slug to aggregate over)
  • suwayomi_chapters_size_bytes: Gauge (size on disk of each manga)
  • suwayomi_extension_download_speed: Histogram (download speed in Bytes/second for each extension)
  • suwayomi_extension_rate_limited: Gauge (whether an extension is rate limited by their respective backend)

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:

  • extension_id
  • chapter_slug
  • chapter_number
  • chapter_language

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.

@sbordeyne sbordeyne added the enhancement New feature or request label Apr 19, 2024
@Robonau
Copy link
Contributor

Robonau commented Apr 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants