Set labels for victoria* metrics

This commit is contained in:
SebastianStork 2025-09-20 23:37:30 +02:00
parent 387af935d1
commit 3294e96bf9
2 changed files with 11 additions and 5 deletions

View file

@ -64,8 +64,8 @@ in
}
prometheus.scrape "node_exporter" {
targets = prometheus.exporter.unix.default.targets
forward_to = [prometheus.remote_write.default.receiver]
targets = prometheus.exporter.unix.default.targets
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "15s"
}
'';
@ -76,8 +76,10 @@ in
prometheus.scrape "victorialogs" {
targets = [{
__address__ = "localhost:${builtins.toString config.custom.services.victorialogs.port}",
job = "victorialogs",
instance = constants.hostname,
}]
forward_to = [prometheus.remote_write.default.receiver]
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "15s"
}
'';
@ -86,7 +88,7 @@ in
"alloy/sshd-logs.alloy" = lib.mkIf cfg.collect.sshdLogs {
text = ''
loki.source.journal "sshd" {
matches = "_SYSTEMD_UNIT=sshd.service"
matches = "_SYSTEMD_UNIT=sshd.service"
forward_to = [loki.write.default.receiver]
}
'';