From b07e10139c88d6060e57ca52b2dc12b17b53ac82 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 21 May 2023 23:10:32 +0300 Subject: 2023-05-21 --- modules/nixos/monitoring/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/nixos/monitoring/default.nix') diff --git a/modules/nixos/monitoring/default.nix b/modules/nixos/monitoring/default.nix index 37e34d9..7f62874 100644 --- a/modules/nixos/monitoring/default.nix +++ b/modules/nixos/monitoring/default.nix @@ -122,8 +122,6 @@ in { loki.configuration.ruler.alertmanager_url = "https://${config.nixfiles.modules.alertmanager.domain}"; prometheus = { - # It would be nice if these could be generated dynamically. That would - # require a complete rework of how configurations are defined, though. scrapeConfigs = with my.configurations; mapAttrsToList ( @@ -144,13 +142,15 @@ in { hosts; } ]; - relabel_configs = [ - { - source_labels = ["__address__"]; - regex = "([^:]+):\\d+"; - target_label = "instance"; - } - ]; + relabel_configs = + [ + { + source_labels = ["__address__"]; + regex = "([^:]+):\\d+"; + target_label = "instance"; + } + ] + ++ optionals (hasAttr "relabel" value) value.relabel; } ) { -- cgit 1.4.1