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.

54 changes: 46 additions & 8 deletions nix/modules/arr-grafana.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,55 @@ let
};
in
{
home = g.ratio (
library
// {
links = [
# The Home dashboard's library graph, which the *arr apps share: a bar each
home = {
title = "Library completeness";
description = "Downloaded / monitored items of each *arr app (has and missing)";
type = "bargauge";
unit = "percentunit";
min = 0;
max = 1;
decimals = 1;
options = {
displayMode = "lcd";
namePlacement = "top";
sizing = "auto";
};
custom = { };
order = 212;
w = 6;
h = 4;
links = [
{
title = "Media";
url = "/d/media/media?\${__url_time_range}";
}
];
series.${app} = {
inherit order;
query = g.prom (g.ratioExpr library.good library.all) {
legend = "${library.title} {{good}}/{{all}}";
instant = true;
};
overrides = [
{
title = "Media";
url = "/d/media/media?\${__url_time_range}";
matcher = {
id = "byRegexp";
options = "${library.title} .*";
};
properties = [
{
id = "color";
value = {
mode = "fixed";
fixedColor = "purple";
};
}
];
}
];
}
);
};
};
# Two tiles for the Media dashboard's strip, at `order` and one after, and the library over time with the panels
tiles = {
"${app}-library" = {
Expand Down
1 change: 1 addition & 0 deletions nix/modules/flaresolverr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ in
inputs.setup-secrets.nixosModules.default
]
++ self.lib.importsApply [
./home-area.nix
./logs.nix
../integration-logs.nix
./integration.nix
Expand Down
18 changes: 18 additions & 0 deletions nix/modules/flaresolverr/home-area.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The flaresolverr module's namespace in the `media` area of the Home dashboard, whose CPU, memory and traffic graphs
# sum the containers by area. Added only where homelab-monitoring's Grafana options are declared, without importing
# its module: the flakes' modules import each other, and a module that imports it here would recurse
_:
{
config,
lib,
options,
...
}:
{
config = lib.optionalAttrs (options ? homelab && options.homelab ? grafana) {
homelab.grafana.home.areas.media = {
color = "#b877d9";
namespaces = lib.mkIf config.homelab.flaresolverr.enable [ "flaresolverr" ];
};
};
}
1 change: 1 addition & 0 deletions nix/modules/flood/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ in
debug = lib.mkEnableOption "debug mode";
};
imports = self.lib.importsApply [
./home-area.nix
./logs.nix
../integration-logs.nix
./homepage.nix
Expand Down
18 changes: 18 additions & 0 deletions nix/modules/flood/home-area.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The flood module's namespace in the `media` area of the Home dashboard, whose CPU, memory and traffic graphs
# sum the containers by area. Added only where homelab-monitoring's Grafana options are declared, without importing
# its module: the flakes' modules import each other, and a module that imports it here would recurse
_:
{
config,
lib,
options,
...
}:
{
config = lib.optionalAttrs (options ? homelab && options.homelab ? grafana) {
homelab.grafana.home.areas.media = {
color = "#b877d9";
namespaces = lib.mkIf config.homelab.flood.enable [ "flood" ];
};
};
}
1 change: 1 addition & 0 deletions nix/modules/plex/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ in
inputs.setup-secrets.nixosModules.default
]
++ self.lib.importsApply [
./home-area.nix
./logs.nix
../integration-logs.nix
./integration.nix
Expand Down
19 changes: 1 addition & 18 deletions nix/modules/plex/grafana.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Plex's panels on the Media dashboard and Home, and its row on the Workload dashboard
# Plex's panels on the Media dashboard, and its row on the Workload dashboard
{ inputs, ... }:
{ config, lib, ... }:
let
Expand Down Expand Up @@ -40,23 +40,6 @@ in
'';
};
config = lib.mkIf cfg.grafana.enable {
homelab.grafana.home.tiles.plex = {
group = "Media";
order = 403;
panel = g.stat {
title = "Plex streaming";
unit = "bps";
links = [
{
title = "Media";
url = "/d/media/media?\${__url_time_range}";
}
];
queries = [
(g.prom "sum(rate(transmit_bytes_total{${j}}[$__rate_interval])) * 8" { instant = true; })
];
};
};
homelab.grafana.overviews.media = {
title = "Media";
description = "The media stack: what's missing, downloading, streaming, and the apps' health";
Expand Down
18 changes: 18 additions & 0 deletions nix/modules/plex/home-area.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The plex module's namespace in the `media` area of the Home dashboard, whose CPU, memory and traffic graphs
# sum the containers by area. Added only where homelab-monitoring's Grafana options are declared, without importing
# its module: the flakes' modules import each other, and a module that imports it here would recurse
_:
{
config,
lib,
options,
...
}:
{
config = lib.optionalAttrs (options ? homelab && options.homelab ? grafana) {
homelab.grafana.home.areas.media = {
color = "#b877d9";
namespaces = lib.mkIf config.homelab.plex.enable [ "plex" ];
};
};
}
1 change: 1 addition & 0 deletions nix/modules/prowlarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ in
inputs.homelab-storage.nixosModules.postgresql
]
++ self.lib.importsApply [
./home-area.nix
./logs.nix
../integration-logs.nix
./homepage.nix
Expand Down
2 changes: 1 addition & 1 deletion nix/modules/prowlarr/grafana.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Prowlarr's panels on the Media dashboard and Home, and its row on the Workload dashboard
# Prowlarr's panels on the Media dashboard, and its row on the Workload dashboard
{ inputs, ... }:
{ config, lib, ... }:
let
Expand Down
18 changes: 18 additions & 0 deletions nix/modules/prowlarr/home-area.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The prowlarr module's namespace in the `media` area of the Home dashboard, whose CPU, memory and traffic graphs
# sum the containers by area. Added only where homelab-monitoring's Grafana options are declared, without importing
# its module: the flakes' modules import each other, and a module that imports it here would recurse
_:
{
config,
lib,
options,
...
}:
{
config = lib.optionalAttrs (options ? homelab && options.homelab ? grafana) {
homelab.grafana.home.areas.media = {
color = "#b877d9";
namespaces = lib.mkIf config.homelab.prowlarr.enable [ "prowlarr" ];
};
};
}
1 change: 1 addition & 0 deletions nix/modules/radarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ in
})
]
++ self.lib.importsApply [
./home-area.nix
./logs.nix
./homepage.nix
./grafana.nix
Expand Down
6 changes: 1 addition & 5 deletions nix/modules/radarr/grafana.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ in
'';
};
config = lib.mkIf cfg.grafana.enable {
homelab.grafana.home.tiles.radarr = {
group = "Media";
order = 401;
panel = rows.home;
};
homelab.grafana.home.graphs.library = rows.home;
homelab.grafana.overviews.media = {
title = "Media";
description = "The media stack: what's missing, downloading, streaming, and the apps' health";
Expand Down
18 changes: 18 additions & 0 deletions nix/modules/radarr/home-area.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The radarr module's namespace in the `media` area of the Home dashboard, whose CPU, memory and traffic graphs
# sum the containers by area. Added only where homelab-monitoring's Grafana options are declared, without importing
# its module: the flakes' modules import each other, and a module that imports it here would recurse
_:
{
config,
lib,
options,
...
}:
{
config = lib.optionalAttrs (options ? homelab && options.homelab ? grafana) {
homelab.grafana.home.areas.media = {
color = "#b877d9";
namespaces = lib.mkIf config.homelab.radarr.enable [ "radarr" ];
};
};
}
1 change: 1 addition & 0 deletions nix/modules/rtorrent/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ in
inputs.homelab-networking.nixosModules.cilium-crds
]
++ self.lib.importsApply [
./home-area.nix
./logs.nix
./grafana.nix
./metrics.nix
Expand Down
26 changes: 1 addition & 25 deletions nix/modules/rtorrent/grafana.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# rTorrent's panels on the Media dashboard and Home, and its row on the Workload dashboard
# rTorrent's panels on the Media dashboard, and its row on the Workload dashboard
{ inputs, ... }:
{ config, lib, ... }:
let
Expand Down Expand Up @@ -29,30 +29,6 @@ in
'';
};
config = lib.mkIf cfg.grafana.enable {
homelab.grafana.home.tiles.rtorrent = {
group = "Media";
order = 404;
panel = g.stat {
title = "rTorrent traffic";
unit = "Bps";
links = [
{
title = "Media";
url = "/d/media/media?\${__url_time_range}";
}
];
queries = [
(g.prom "rate(rtorrent_downloaded_bytes_total{${j}}[$__rate_interval])" {
instant = true;
legend = "down";
})
(g.prom "rate(rtorrent_uploaded_bytes_total{${j}}[$__rate_interval])" {
instant = true;
legend = "up";
})
];
};
};
homelab.grafana.overviews.media = {
title = "Media";
description = "The media stack: what's missing, downloading, streaming, and the apps' health";
Expand Down
18 changes: 18 additions & 0 deletions nix/modules/rtorrent/home-area.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The rtorrent module's namespace in the `media` area of the Home dashboard, whose CPU, memory and traffic graphs
# sum the containers by area. Added only where homelab-monitoring's Grafana options are declared, without importing
# its module: the flakes' modules import each other, and a module that imports it here would recurse
_:
{
config,
lib,
options,
...
}:
{
config = lib.optionalAttrs (options ? homelab && options.homelab ? grafana) {
homelab.grafana.home.areas.media = {
color = "#b877d9";
namespaces = lib.mkIf config.homelab.rtorrent.enable [ "rtorrent" ];
};
};
}
1 change: 1 addition & 0 deletions nix/modules/sabnzbd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ in
inputs.homelab-networking.nixosModules.privacy-vpn
]
++ self.lib.importsApply [
./home-area.nix
./logs.nix
../integration-logs.nix
./integration.nix
Expand Down
17 changes: 1 addition & 16 deletions nix/modules/sabnzbd/grafana.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SABnzbd's panels on the Media dashboard and Home, and its row on the Workload dashboard
# SABnzbd's panels on the Media dashboard, and its row on the Workload dashboard
{ inputs, ... }:
{ config, lib, ... }:
let
Expand Down Expand Up @@ -35,21 +35,6 @@ in
'';
};
config = lib.mkIf cfg.grafana.enable {
homelab.grafana.home.tiles.sabnzbd = {
group = "Media";
order = 402;
panel = g.stat {
title = "SABnzbd speed";
unit = "Bps";
links = [
{
title = "Media";
url = "/d/media/media?\${__url_time_range}";
}
];
queries = [ (g.prom "sabnzbd_speed_bps{${j}}" { instant = true; }) ];
};
};
homelab.grafana.overviews.media = {
title = "Media";
description = "The media stack: what's missing, downloading, streaming, and the apps' health";
Expand Down
18 changes: 18 additions & 0 deletions nix/modules/sabnzbd/home-area.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The sabnzbd module's namespace in the `media` area of the Home dashboard, whose CPU, memory and traffic graphs
# sum the containers by area. Added only where homelab-monitoring's Grafana options are declared, without importing
# its module: the flakes' modules import each other, and a module that imports it here would recurse
_:
{
config,
lib,
options,
...
}:
{
config = lib.optionalAttrs (options ? homelab && options.homelab ? grafana) {
homelab.grafana.home.areas.media = {
color = "#b877d9";
namespaces = lib.mkIf config.homelab.sabnzbd.enable [ "sabnzbd" ];
};
};
}
1 change: 1 addition & 0 deletions nix/modules/sonarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ in
})
]
++ self.lib.importsApply [
./home-area.nix
./logs.nix
./homepage.nix
./grafana.nix
Expand Down
Loading