mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 21:01:34 +01:00
Set labels for victoria* metrics
This commit is contained in:
parent
387af935d1
commit
3294e96bf9
2 changed files with 11 additions and 5 deletions
|
|
@ -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]
|
||||
}
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -50,7 +50,11 @@ in
|
|||
}
|
||||
);
|
||||
listenAddress = "localhost:${builtins.toString cfg.port}";
|
||||
extraOptions = [ "-selfScrapeInterval=15s" ];
|
||||
extraOptions = [
|
||||
"-selfScrapeInterval=15s"
|
||||
"-selfScrapeJob=victoriametrics"
|
||||
"-selfScrapeInstance=${config.networking.hostName}"
|
||||
];
|
||||
};
|
||||
|
||||
custom.persist.directories = [ "/var/lib/${config.services.victoriametrics.stateDir}" ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue