[PR #11539] Add metrics collector to disposable parts #12938

Closed
opened 2026-02-07 07:04:26 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/11539

State: closed
Merged: Yes


Fixes following exception (and infinite startup loop):

[15:50:33] [FTL] [14] Main: Error while starting server
System.InvalidOperationException: .NET runtime metrics are already being collected. Dispose() of your previous collector before calling this method again.
   at Prometheus.DotNetRuntime.DotNetRuntimeStatsCollector..ctor(ServiceProvider serviceProvider, CollectorRegistry metricRegistry, Options options)
   at Prometheus.DotNetRuntime.DotNetRuntimeStatsBuilder.Builder.StartCollecting(CollectorRegistry registry)
   at Prometheus.DotNetRuntime.DotNetRuntimeStatsBuilder.Builder.StartCollecting()
   at Emby.Server.Implementations.ApplicationHost.Init(IServiceCollection serviceCollection) in /home/crobibero/Code/jellyfin/Emby.Server.Implementations/ApplicationHost.cs:line 425
   at Jellyfin.Server.Program.<>c__DisplayClass8_0.<StartServer>b__0(IServiceCollection services) in /home/crobibero/Code/jellyfin/Jellyfin.Server/Program.cs:line 142
   at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig) in /home/crobibero/Code/jellyfin/Jellyfin.Server/Program.cs:line 140
**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/11539 **State:** closed **Merged:** Yes --- Fixes following exception (and infinite startup loop): ``` [15:50:33] [FTL] [14] Main: Error while starting server System.InvalidOperationException: .NET runtime metrics are already being collected. Dispose() of your previous collector before calling this method again. at Prometheus.DotNetRuntime.DotNetRuntimeStatsCollector..ctor(ServiceProvider serviceProvider, CollectorRegistry metricRegistry, Options options) at Prometheus.DotNetRuntime.DotNetRuntimeStatsBuilder.Builder.StartCollecting(CollectorRegistry registry) at Prometheus.DotNetRuntime.DotNetRuntimeStatsBuilder.Builder.StartCollecting() at Emby.Server.Implementations.ApplicationHost.Init(IServiceCollection serviceCollection) in /home/crobibero/Code/jellyfin/Emby.Server.Implementations/ApplicationHost.cs:line 425 at Jellyfin.Server.Program.<>c__DisplayClass8_0.<StartServer>b__0(IServiceCollection services) in /home/crobibero/Code/jellyfin/Jellyfin.Server/Program.cs:line 142 at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig) in /home/crobibero/Code/jellyfin/Jellyfin.Server/Program.cs:line 140 ```
OVERLORD added the pull-request label 2026-02-07 07:04:26 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#12938