mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
service/jellyfin: enable metrics
This commit is contained in:
parent
017e293241
commit
ce557d2379
2 changed files with 36 additions and 0 deletions
|
@ -4,6 +4,11 @@ let
|
||||||
cfg = config.my.services.jellyfin;
|
cfg = config.my.services.jellyfin;
|
||||||
domain = config.networking.domain;
|
domain = config.networking.domain;
|
||||||
port = 8096;
|
port = 8096;
|
||||||
|
# enable monitoring
|
||||||
|
jellyfin-with-metrics = pkgs.jellyfin.overrideAttrs (attrs: {
|
||||||
|
# with this patch the default setting for metrics is changed
|
||||||
|
patches = attrs.patches ++ [ ./enable-metrics.patch ];
|
||||||
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.jellyfin = with lib; {
|
options.my.services.jellyfin = with lib; {
|
||||||
|
@ -13,8 +18,26 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.jellyfin = {
|
services.jellyfin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = jellyfin-with-metrics;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.prometheus = {
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "jellyfin";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = [ "127.0.0.1:${toString cfg.port}" ];
|
||||||
|
labels = {
|
||||||
|
instance = config.networking.hostName;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# sadly the metrics do not contain application specific metrics, only c# -> no dashboard
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = [
|
my.services.nginx.virtualHosts = [
|
||||||
{
|
{
|
||||||
subdomain = "media";
|
subdomain = "media";
|
||||||
|
|
13
modules/services/jellyfin/enable-metrics.patch
Normal file
13
modules/services/jellyfin/enable-metrics.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
|
||||||
|
index 07f02d1879..0f1c2e0cb8 100644
|
||||||
|
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
|
||||||
|
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
|
||||||
|
@@ -66,7 +66,7 @@ namespace MediaBrowser.Model.Configuration
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether to enable prometheus metrics exporting.
|
||||||
|
/// </summary>
|
||||||
|
- public bool EnableMetrics { get; set; } = false;
|
||||||
|
+ public bool EnableMetrics { get; set; } = true;
|
||||||
|
|
||||||
|
public bool EnableNormalizedItemByNameIds { get; set; } = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue