Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions nix/modules/plex/metrics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
let
cfg = config.homelab.plex;
# Its published image (alpine and the binary; no releases, so main by digest), pinned in the Dockerfile here
image = (inputs.homelab-shared.lib.images.pinned pkgs ./Dockerfile)."ghcr.io/jsclayton/prometheus-plex-exporter";
image =
(inputs.homelab-shared.lib.images.pinned pkgs ./Dockerfile)
."ghcr.io/jsclayton/prometheus-plex-exporter";
# The exporter takes the admin token in PLEX_TOKEN. Plex keeps it in Preferences.xml once claimed, on the data
# volume the sidecar mounts read-only: wait until it's there, then exec the exporter. Waiting keeps the pod Ready,
# so an unclaimed Plex stays reachable to be claimed; when the exporter exits, the kubelet restarts it
Expand All @@ -28,7 +30,13 @@ let
in
{
imports = [ inputs.homelab-monitoring.nixosModules.alloy ];
config = lib.mkIf cfg.enable (
options.homelab.plex.metrics.enable = lib.mkOption {
description = "Whether Alloy scrapes Plex's metrics, and runs its prometheus-plex-exporter sidecar.";
type = lib.types.bool;
default = config.homelab.alloy.enable;
defaultText = lib.literalExpression "config.homelab.alloy.enable";
};
config = lib.mkIf (cfg.enable && cfg.metrics.enable) (
lib.mkMerge [
{ homelab.alloy.monitors.plex.podPort = port; }
(lib.mkIf config.homelab.alloy.enable {
Expand Down
8 changes: 7 additions & 1 deletion nix/modules/prowlarr/metrics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ let
in
{
imports = [ inputs.homelab-monitoring.nixosModules.alloy ];
config = lib.mkIf config.homelab.prowlarr.enable (
options.homelab.prowlarr.metrics.enable = lib.mkOption {
description = "Whether Alloy scrapes Prowlarr's metrics, and runs its exportarr sidecar.";
type = lib.types.bool;
default = config.homelab.alloy.enable;
defaultText = lib.literalExpression "config.homelab.alloy.enable";
};
config = lib.mkIf (config.homelab.prowlarr.enable && config.homelab.prowlarr.metrics.enable) (
lib.mkMerge [
{ homelab.alloy.monitors.prowlarr.podPort = exportarr.port; }
(lib.mkIf config.homelab.alloy.enable {
Expand Down
8 changes: 7 additions & 1 deletion nix/modules/radarr/metrics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ let
in
{
imports = [ inputs.homelab-monitoring.nixosModules.alloy ];
config = lib.mkIf config.homelab.radarr.enable (
options.homelab.radarr.metrics.enable = lib.mkOption {
description = "Whether Alloy scrapes Radarr's metrics, and runs its exportarr sidecar.";
type = lib.types.bool;
default = config.homelab.alloy.enable;
defaultText = lib.literalExpression "config.homelab.alloy.enable";
};
config = lib.mkIf (config.homelab.radarr.enable && config.homelab.radarr.metrics.enable) (
lib.mkMerge [
{
homelab.alloy.monitors.radarr = {
Expand Down
8 changes: 7 additions & 1 deletion nix/modules/rtorrent/metrics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ let
in
{
imports = [ inputs.homelab-monitoring.nixosModules.alloy ];
config = lib.mkIf cfg.enable (
options.homelab.rtorrent.metrics.enable = lib.mkOption {
description = "Whether Alloy scrapes rtorrent's metrics, and runs its rtorrent_exporter and SCGI bridge sidecars.";
type = lib.types.bool;
default = config.homelab.alloy.enable;
defaultText = lib.literalExpression "config.homelab.alloy.enable";
};
config = lib.mkIf (cfg.enable && cfg.metrics.enable) (
lib.mkMerge [
{ homelab.alloy.monitors.rtorrent.podPort = metricsPort; }
(lib.mkIf config.homelab.alloy.enable {
Expand Down
8 changes: 7 additions & 1 deletion nix/modules/sabnzbd/metrics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ let
in
{
imports = [ inputs.homelab-monitoring.nixosModules.alloy ];
config = lib.mkIf config.homelab.sabnzbd.enable (
options.homelab.sabnzbd.metrics.enable = lib.mkOption {
description = "Whether Alloy scrapes SABnzbd's metrics, and runs its exportarr sidecar.";
type = lib.types.bool;
default = config.homelab.alloy.enable;
defaultText = lib.literalExpression "config.homelab.alloy.enable";
};
config = lib.mkIf (config.homelab.sabnzbd.enable && config.homelab.sabnzbd.metrics.enable) (
lib.mkMerge [
{ homelab.alloy.monitors.sabnzbd.podPort = exportarr.port; }
(lib.mkIf config.homelab.alloy.enable {
Expand Down
8 changes: 7 additions & 1 deletion nix/modules/sonarr/metrics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ let
in
{
imports = [ inputs.homelab-monitoring.nixosModules.alloy ];
config = lib.mkIf config.homelab.sonarr.enable (
options.homelab.sonarr.metrics.enable = lib.mkOption {
description = "Whether Alloy scrapes Sonarr's metrics, and runs its exportarr sidecar.";
type = lib.types.bool;
default = config.homelab.alloy.enable;
defaultText = lib.literalExpression "config.homelab.alloy.enable";
};
config = lib.mkIf (config.homelab.sonarr.enable && config.homelab.sonarr.metrics.enable) (
lib.mkMerge [
{
homelab.alloy.monitors.sonarr = {
Expand Down
Loading