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

Add prometheus metric for item counts #9290

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

clbx
Copy link

@clbx clbx commented Feb 10, 2023

Changes

Updated the prometheus metrics endpoint written by @holahmeds in #6882 to be up to date with main.

Adds jellyfin_library_items_total to the metrics endpoint which will return the amount of every item in the library.

  • Audio
  • Book
  • Episode
  • Movie
  • MusicAlbum
  • MusicArtist
  • MusicVideo
  • Photo
  • PhotoAlbum
  • Season
  • Series

Issues

Contributes to #3016

@clbx
Copy link
Author

clbx commented Feb 22, 2023

@robertas90poe you approved the original PR for this not too long ago, could you take a look at this?

Copy link

@robertas90poe robertas90poe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@clbx
Copy link
Author

clbx commented Mar 6, 2023

@cvium you had commented on the previous iteration of this PR, could you take a look?

@cvium
Copy link
Member

cvium commented Mar 6, 2023

Honestly, it's not great that it relies on DB queries. The database is already heavily abused.

@clbx
Copy link
Author

clbx commented Mar 7, 2023

Gotcha, I will look into ways to get the information without continuously querying the database when I have some free time. Thanks for taking a look.

@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label May 4, 2023
@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@oddstr13
Copy link
Member

oddstr13 commented Nov 5, 2023

While the db queries here is less than great, it would be great to at least get some basic Jellyfin stuff in, like the Jellyfin version (something ala dotnet_build_info for Jellyfin specific info).

Do you think you could create a PR for something really basic, that doesn't depend on any db queries so we can get the ball rolling?

# HELP dotnet_build_info Build information about prometheus-net.DotNetRuntime and the environment
# TYPE dotnet_build_info gauge
dotnet_build_info{version="4.2.4.0",target_framework=".NETCoreApp,Version=v6.0",runtime_version=".NET 6.0.9",os_version="Linux 5.15.0-84-generic #93-Ubuntu SMP Tue Sep 5 17:16:10 UTC 2023",process_architecture="X64",gc_mode="Workstation"} 1

@arthurlutz
Copy link

Maybe querying the database is OK if there's a cache or if the target is only scraped every hour ? For this type of data I don't think the granularity needs to be by the minute...

@clbx
Copy link
Author

clbx commented Nov 27, 2023

Personally, I think having it cached and then scraped at an interval is an acceptable solution, not necessarily ideal. I spent a little bit of time trying to figure out how to get that information without hitting the database, but I'm not familiar enough with the codebase (or C# really ) to have any success.

@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label Nov 27, 2023
@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label Dec 5, 2023
@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@JPVenson JPVenson added good first issue Good for newcomers backend Related to the server backend needs testing labels Jan 2, 2024
@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label Jan 4, 2024
@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label May 13, 2024
@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@BBArikL
Copy link

BBArikL commented Aug 27, 2024

Is this PR still scheduled for a release? Having more data that could be exported for external metrics collectors would be great!

@DomiiBunn
Copy link

@BBArikL

Is this PR still scheduled for a release? Having more data that could be exported for external metrics collectors would be great!

Check out jellystat

@BBArikL
Copy link

BBArikL commented Aug 27, 2024

Jellystat seems interesting but having a dedicated app only for jellyfin feels a litte bit too much. Using prometheus + grafana helps get all the data and visualisation at the same place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to the server backend good first issue Good for newcomers merge conflict Merge conflicts should be resolved before a merge needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.