diff --git a/nix-system-configs/modules/system/traefik.nix b/nix-system-configs/modules/system/traefik.nix index edd6599..f6ff0f1 100644 --- a/nix-system-configs/modules/system/traefik.nix +++ b/nix-system-configs/modules/system/traefik.nix @@ -199,16 +199,20 @@ in { # See: https://github.com/grafana/alloy/blob/bbe11b0f6a3bd3391108b2d27122c654c535dd8d/docs/sources/set-up/migrate/from-promtail.md environment.etc."alloy/config.alloy" = { text = '' - prometheus.scrape integrations_traefik { - targets = [{ __address__ = "localhost:8080" }] - job_name = "integrations/traefik" + discovery.relabel "metrics_integrations_integrations_traefik" { + targets = [{ + __address__ = "localhost:8080", + }] - relabel set_instance_label { - rule { - target_label = "instance" - replacement = constants.hostname - } - } + rule { + target_label = "instance" + replacement = constants.hostname + } + } + + prometheus.scrape "metrics_integrations_integrations_traefik" { + targets = discovery.relabel.metrics_integrations_integrations_traefik.output + job_name = "integrations/traefik" } ''; group = "root";