[PR #14052] Enable metrics via an environmental variable, optionally separate Port #13815

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

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14052
Author: @cbcoutinho
Created: 5/3/2025
Status: 🔄 Open

Base: masterHead: master


📝 Commits (7)

  • d251aa5 Enable metrics via an environmental variable
  • 04dc095 Enable /metrics endpoint to be accessible on separate port
  • ba6c415 Update Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs
  • 86e00e9 Make it possible to disable metrics using environment variable
  • 131f5ad Merge remote-tracking branch 'upstream/master'
  • f224ec3 Merge remote-tracking branch 'upstream/master'
  • dfda4a6 Merge remote-tracking branch 'upstream/master'

📊 Changes

6 files changed (+78 additions, -5 deletions)

View changed files

📝 Emby.Server.Implementations/ApplicationHost.cs (+1 -1)
📝 Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs (+39 -1)
📝 Jellyfin.Server/Program.cs (+20 -1)
📝 Jellyfin.Server/ServerSetupApp/SetupServer.cs (+1 -1)
📝 Jellyfin.Server/Startup.cs (+10 -1)
📝 MediaBrowser.Model/Configuration/ServerConfiguration.cs (+7 -0)

📄 Description

Changes
This change builds on #10503, enabling exposing prometheus metrics via an environmental variable rather than updating the system configuration file. This is necessary in containerized environments where the configuration file is not available at startup and requires some workarounds when deploying to Kubernetes. Additionally, users can specify a separate HTTP port to host the /metrics endpoint. If set to 0 - the default - the /metrics endpoint will be exposed on the default server port.

Users can set the following environmental variables to configure metrics at startup:

  • JELLYFIN_EnableMetrics
  • JELLYFIN_MetricsListenPort

As requested in the original PR, the changes have been moved to ServerConfigurationManager.

Issues
Fixes #6247


🔄 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/14052 **Author:** [@cbcoutinho](https://github.com/cbcoutinho) **Created:** 5/3/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (7) - [`d251aa5`](https://github.com/jellyfin/jellyfin/commit/d251aa542a2ed6b83eb1cf58e72fd5f75f520f3e) Enable metrics via an environmental variable - [`04dc095`](https://github.com/jellyfin/jellyfin/commit/04dc0956b812810c64d1a60ad03f2b6b986e9daf) Enable /metrics endpoint to be accessible on separate port - [`ba6c415`](https://github.com/jellyfin/jellyfin/commit/ba6c4151c3c5c003124a57400bbe648dfbfee436) Update Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs - [`86e00e9`](https://github.com/jellyfin/jellyfin/commit/86e00e9f5518817cf02f654e90da13c4c85202da) Make it possible to disable metrics using environment variable - [`131f5ad`](https://github.com/jellyfin/jellyfin/commit/131f5ad55b53f8efcd84357107518a1cf7efceb7) Merge remote-tracking branch 'upstream/master' - [`f224ec3`](https://github.com/jellyfin/jellyfin/commit/f224ec3e61b06798dbc1f6668788d0128c9ce7ec) Merge remote-tracking branch 'upstream/master' - [`dfda4a6`](https://github.com/jellyfin/jellyfin/commit/dfda4a6d1355a9c388a470ced07088f2d32aab95) Merge remote-tracking branch 'upstream/master' ### 📊 Changes **6 files changed** (+78 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/ApplicationHost.cs` (+1 -1) 📝 `Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs` (+39 -1) 📝 `Jellyfin.Server/Program.cs` (+20 -1) 📝 `Jellyfin.Server/ServerSetupApp/SetupServer.cs` (+1 -1) 📝 `Jellyfin.Server/Startup.cs` (+10 -1) 📝 `MediaBrowser.Model/Configuration/ServerConfiguration.cs` (+7 -0) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** This change builds on #10503, enabling exposing prometheus metrics via an environmental variable rather than updating the system configuration file. This is necessary in containerized environments where the configuration file is not available at startup and requires some workarounds when deploying to Kubernetes. Additionally, users can specify a separate HTTP port to host the `/metrics` endpoint. If set to `0` - the default - the `/metrics` endpoint will be exposed on the default server port. Users can set the following environmental variables to configure metrics at startup: - `JELLYFIN_EnableMetrics` - `JELLYFIN_MetricsListenPort` As requested in the original PR, the changes have been moved to `ServerConfigurationManager`. **Issues** Fixes #6247 --- <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:19:38 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13815