service/jellyfin: enable metrics

This commit is contained in:
Felix Buehler 2023-06-03 22:42:21 +02:00
parent 017e293241
commit ce557d2379
2 changed files with 36 additions and 0 deletions

View file

@ -4,6 +4,11 @@ let
cfg = config.my.services.jellyfin;
domain = config.networking.domain;
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
{
options.my.services.jellyfin = with lib; {
@ -13,8 +18,26 @@ in
config = lib.mkIf cfg.enable {
services.jellyfin = {
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 = [
{
subdomain = "media";