[PR #14920] Prometheus metrics #14174

Open
opened 2026-02-07 07:25:37 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14920
Author: @ysf3rdm
Created: 10/1/2025
Status: 🔄 Open

Base: masterHead: prometheus-metrics-10.11


📝 Commits (10+)

  • fb2699b User Metrics Added
  • fc9041f circular dependency issue resolved
  • 04229a7 Merge branch 'jellyfin:master' into prometheus-metrics-10.11
  • 81092b2 Update Jellyfin Server version in issue template (#15398)
  • 75b757a Update appleboy/ssh-action action to v1.2.3
  • 72c4a6f Update dependency z440.atl.core to 7.7.0
  • ceb8305 Update dependency FsCheck.Xunit to 3.3.2
  • cd4c609 Translated using Weblate (English (Pirate))
  • 20054d3 Translated using Weblate (Vietnamese)
  • c1f079c Update CI dependencies

📊 Changes

8 files changed (+500 additions, -2 deletions)

View changed files

📝 CONTRIBUTORS.md (+1 -0)
📝 Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj (+1 -0)
Jellyfin.Server.Implementations/Metrics/SessionMetrics.cs (+184 -0)
Jellyfin.Server.Implementations/Metrics/UserMetrics.cs (+281 -0)
📝 Jellyfin.Server.Implementations/Users/UserManager.cs (+23 -2)
📝 Jellyfin.Server/CoreAppHost.cs (+1 -0)
📝 Jellyfin.Server/Startup.cs (+4 -0)
📝 MediaBrowser.Controller/Library/IUserManager.cs (+5 -0)

📄 Description

Changes

This only implements user account metrics for now as outlined in #3016. This PR adds a new UserMetrics class that tracks user accounts, permissions, authentication providers, activity, and security metrics.

Implemented Metrics:

  • jellyfin_user_accounts_total - Total number of user accounts
  • jellyfin_user_accounts_active - Number of active (non-disabled) accounts
  • jellyfin_user_accounts_admin - Number of administrator accounts
  • jellyfin_users_by_permission - Users with specific permissions (labeled by permission type)
  • jellyfin_users_by_auth_provider - Users by authentication provider (labeled by provider)
  • jellyfin_users_external_auth_total - Total users using external authentication
  • jellyfin_users_recently_active - Users active within last 30 days
  • jellyfin_users_failed_logins - Users with failed login attempts (labeled by attempt range)

Planned Metrics (from #3016):

  • Session metrics (active sessions, device types, client types)
  • Stream metrics (play methods, transcoding, codecs)
  • Library metrics (library counts, media types, codec distribution)

Questions for Reviewers

  1. Label Cardinality: Currently using AuthenticationProviderId as a dynamic label for the auth provider metric. In typical Jellyfin installations, how many distinct auth providers exist? Should this be categorized into "Default" vs "External" instead to prevent unbounded cardinality growth?

  2. Architecture: Should the remaining metrics (sessions, streams, libraries) be in separate classes following the same pattern, or would you prefer a different organization?

  3. Additional Metrics: Are there any other user-related or Jellyfin-specific metrics you'd like to see added? Please suggest in the comments.

Issues

#3016


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/14920 **Author:** [@ysf3rdm](https://github.com/ysf3rdm) **Created:** 10/1/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `prometheus-metrics-10.11` --- ### 📝 Commits (10+) - [`fb2699b`](https://github.com/jellyfin/jellyfin/commit/fb2699b37b9fd1bb35685e898986a2951e6ec3c4) User Metrics Added - [`fc9041f`](https://github.com/jellyfin/jellyfin/commit/fc9041f72b3d9fc805881582cf02a76792ee0cce) circular dependency issue resolved - [`04229a7`](https://github.com/jellyfin/jellyfin/commit/04229a7f91f229ded453720a854a4d14f58bc74e) Merge branch 'jellyfin:master' into prometheus-metrics-10.11 - [`81092b2`](https://github.com/jellyfin/jellyfin/commit/81092b2fb26fe95595f5e496d4e064b79b43093e) Update Jellyfin Server version in issue template (#15398) - [`75b757a`](https://github.com/jellyfin/jellyfin/commit/75b757ac72dd58a11be3ef47dc8f456926dfa781) Update appleboy/ssh-action action to v1.2.3 - [`72c4a6f`](https://github.com/jellyfin/jellyfin/commit/72c4a6f8f79a9b49945eae75a7099761387b179f) Update dependency z440.atl.core to 7.7.0 - [`ceb8305`](https://github.com/jellyfin/jellyfin/commit/ceb8305d7201df7194394acb4dd3ec851fed8965) Update dependency FsCheck.Xunit to 3.3.2 - [`cd4c609`](https://github.com/jellyfin/jellyfin/commit/cd4c609508699c1e5ed3ac72bcf3e6d2868c7e9e) Translated using Weblate (English (Pirate)) - [`20054d3`](https://github.com/jellyfin/jellyfin/commit/20054d398fdf3d75a2f17e95741b7bf42fb30ac3) Translated using Weblate (Vietnamese) - [`c1f079c`](https://github.com/jellyfin/jellyfin/commit/c1f079cd6ba9d69f0c0e5eeb561cfbc1ab972851) Update CI dependencies ### 📊 Changes **8 files changed** (+500 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj` (+1 -0) ➕ `Jellyfin.Server.Implementations/Metrics/SessionMetrics.cs` (+184 -0) ➕ `Jellyfin.Server.Implementations/Metrics/UserMetrics.cs` (+281 -0) 📝 `Jellyfin.Server.Implementations/Users/UserManager.cs` (+23 -2) 📝 `Jellyfin.Server/CoreAppHost.cs` (+1 -0) 📝 `Jellyfin.Server/Startup.cs` (+4 -0) 📝 `MediaBrowser.Controller/Library/IUserManager.cs` (+5 -0) </details> ### 📄 Description **Changes** This only implements user account metrics for now as outlined in #3016. This PR adds a new `UserMetrics` class that tracks user accounts, permissions, authentication providers, activity, and security metrics. **Implemented Metrics:** - [x] `jellyfin_user_accounts_total` - Total number of user accounts - [x] `jellyfin_user_accounts_active` - Number of active (non-disabled) accounts - [x] `jellyfin_user_accounts_admin` - Number of administrator accounts - [x] `jellyfin_users_by_permission` - Users with specific permissions (labeled by permission type) - [x] `jellyfin_users_by_auth_provider` - Users by authentication provider (labeled by provider) - [x] `jellyfin_users_external_auth_total` - Total users using external authentication - [x] `jellyfin_users_recently_active` - Users active within last 30 days - [x] `jellyfin_users_failed_logins` - Users with failed login attempts (labeled by attempt range) **Planned Metrics (from #3016):** - [x] Session metrics (active sessions, device types, client types) - [x] Stream metrics (play methods, transcoding, codecs) - [ ] Library metrics (library counts, media types, codec distribution) **Questions for Reviewers** 1. **Label Cardinality**: Currently using `AuthenticationProviderId` as a dynamic label for the auth provider metric. In typical Jellyfin installations, how many distinct auth providers exist? Should this be categorized into "Default" vs "External" instead to prevent unbounded cardinality growth? 2. **Architecture**: Should the remaining metrics (sessions, streams, libraries) be in separate classes following the same pattern, or would you prefer a different organization? 3. **Additional Metrics**: Are there any other user-related or Jellyfin-specific metrics you'd like to see added? Please suggest in the comments. **Issues** #3016 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:25:37 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14174