|
|
|
@@ -15,7 +15,9 @@ in
|
|
|
|
# -- Jellyfin Prometheus Exporter --
|
|
|
|
# -- Jellyfin Prometheus Exporter --
|
|
|
|
# Replaces custom jellyfin-collector.nix textfile timer.
|
|
|
|
# Replaces custom jellyfin-collector.nix textfile timer.
|
|
|
|
# Exposes per-session metrics (jellyfin_now_playing_state) and library stats.
|
|
|
|
# Exposes per-session metrics (jellyfin_now_playing_state) and library stats.
|
|
|
|
systemd.services.jellyfin-exporter = lib.mkIf (config.services.grafana.enable && config.services.jellyfin.enable) {
|
|
|
|
systemd.services.jellyfin-exporter =
|
|
|
|
|
|
|
|
lib.mkIf (config.services.grafana.enable && config.services.jellyfin.enable)
|
|
|
|
|
|
|
|
{
|
|
|
|
description = "Prometheus exporter for Jellyfin";
|
|
|
|
description = "Prometheus exporter for Jellyfin";
|
|
|
|
after = [
|
|
|
|
after = [
|
|
|
|
"network.target"
|
|
|
|
"network.target"
|
|
|
|
@@ -23,7 +25,8 @@ in
|
|
|
|
];
|
|
|
|
];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
|
|
|
ExecStart = lib.getExe (
|
|
|
|
|
|
|
|
pkgs.writeShellApplication {
|
|
|
|
name = "jellyfin-exporter-wrapper";
|
|
|
|
name = "jellyfin-exporter-wrapper";
|
|
|
|
runtimeInputs = [ pkgs.jellyfin-exporter ];
|
|
|
|
runtimeInputs = [ pkgs.jellyfin-exporter ];
|
|
|
|
text = ''
|
|
|
|
text = ''
|
|
|
|
@@ -32,7 +35,8 @@ in
|
|
|
|
--jellyfin.token="$(cat "$CREDENTIALS_DIRECTORY/jellyfin-api-key")" \
|
|
|
|
--jellyfin.token="$(cat "$CREDENTIALS_DIRECTORY/jellyfin-api-key")" \
|
|
|
|
--web.listen-address=127.0.0.1:${toString jellyfinExporterPort}
|
|
|
|
--web.listen-address=127.0.0.1:${toString jellyfinExporterPort}
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
Restart = "on-failure";
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "10s";
|
|
|
|
RestartSec = "10s";
|
|
|
|
DynamicUser = true;
|
|
|
|
DynamicUser = true;
|
|
|
|
@@ -49,7 +53,9 @@ in
|
|
|
|
# Replaces custom qbittorrent-collector.nix textfile timer.
|
|
|
|
# Replaces custom qbittorrent-collector.nix textfile timer.
|
|
|
|
# Exposes per-torrent metrics (qbit_dlspeed, qbit_upspeed) and aggregate stats.
|
|
|
|
# Exposes per-torrent metrics (qbit_dlspeed, qbit_upspeed) and aggregate stats.
|
|
|
|
# qBittorrent runs in a VPN namespace; the exporter reaches it via namespace address.
|
|
|
|
# qBittorrent runs in a VPN namespace; the exporter reaches it via namespace address.
|
|
|
|
systemd.services.qbittorrent-exporter = lib.mkIf (config.services.grafana.enable && config.services.qbittorrent.enable) {
|
|
|
|
systemd.services.qbittorrent-exporter =
|
|
|
|
|
|
|
|
lib.mkIf (config.services.grafana.enable && config.services.qbittorrent.enable)
|
|
|
|
|
|
|
|
{
|
|
|
|
description = "Prometheus exporter for qBittorrent";
|
|
|
|
description = "Prometheus exporter for qBittorrent";
|
|
|
|
after = [
|
|
|
|
after = [
|
|
|
|
"network.target"
|
|
|
|
"network.target"
|
|
|
|
@@ -57,7 +63,9 @@ in
|
|
|
|
];
|
|
|
|
];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = lib.getExe' inputs.qbittorrent-metrics-exporter.packages.${pkgs.system}.default "qbittorrent-metrics-exporter";
|
|
|
|
ExecStart =
|
|
|
|
|
|
|
|
lib.getExe' inputs.qbittorrent-metrics-exporter.packages.${pkgs.system}.default
|
|
|
|
|
|
|
|
"qbittorrent-metrics-exporter";
|
|
|
|
Restart = "on-failure";
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "10s";
|
|
|
|
RestartSec = "10s";
|
|
|
|
DynamicUser = true;
|
|
|
|
DynamicUser = true;
|
|
|
|
|