Yohan Belval 2 weeks ago committed by GitHub
commit e810cfe6bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -260,6 +260,8 @@ namespace Emby.Server.Implementations
/// <inheritdoc/>
public bool ListenWithHttps => Certificate is not null && ConfigurationManager.GetNetworkConfiguration().EnableHttps;
public bool EnableMetrics => ConfigurationManager.Configuration.EnableMetrics || this._startupConfig.GetValue<bool>(EnableMetricsKey);
public string FriendlyName =>
string.IsNullOrEmpty(ConfigurationManager.Configuration.ServerName)
? Environment.MachineName
@ -420,7 +422,7 @@ namespace Emby.Server.Implementations
NetManager = new NetworkManager(ConfigurationManager, _startupConfig, LoggerFactory.CreateLogger<NetworkManager>());
// Initialize runtime stat collection
if (ConfigurationManager.Configuration.EnableMetrics)
if (this.EnableMetrics)
{
DotNetRuntimeStatsBuilder.Default().StartCollecting();
}

@ -19,7 +19,8 @@ namespace Emby.Server.Implementations
{ FfmpegAnalyzeDurationKey, "200M" },
{ PlaylistsAllowDuplicatesKey, bool.FalseString },
{ BindToUnixSocketKey, bool.FalseString },
{ SqliteCacheSizeKey, "20000" }
{ SqliteCacheSizeKey, "20000" },
{ EnableMetricsKey, bool.FalseString }
};
}
}

@ -211,7 +211,7 @@ namespace Jellyfin.Server
mainApp.UseWebSocketHandler();
mainApp.UseServerStartupMessage();
if (_serverConfigurationManager.Configuration.EnableMetrics)
if (_serverApplicationHost.EnableMetrics)
{
// Must be registered after any middleware that could change HTTP response codes or the data will be bad
mainApp.UseHttpMetrics();
@ -220,7 +220,7 @@ namespace Jellyfin.Server
mainApp.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
if (_serverConfigurationManager.Configuration.EnableMetrics)
if (_serverApplicationHost.EnableMetrics)
{
endpoints.MapMetrics();
}

@ -64,6 +64,11 @@ namespace MediaBrowser.Controller.Extensions
/// </summary>
public const string SqliteCacheSizeKey = "sqlite:cacheSize";
/// <summary>
/// The key for enabling the metrics endpoint.
/// </summary>
public const string EnableMetricsKey = "EnableMetrics";
/// <summary>
/// Gets a value indicating whether the application should host static web content from the <see cref="IConfiguration"/>.
/// </summary>

@ -38,6 +38,11 @@ namespace MediaBrowser.Controller
/// <value>The name of the friendly.</value>
string FriendlyName { get; }
/// <summary>
/// Gets a value indicating whether if the server should enable the metrics endpoint.
/// </summary>
bool EnableMetrics { get; }
/// <summary>
/// Gets a URL specific for the request.
/// </summary>

Loading…
Cancel
Save