grafana: Add victorialogs dashboard

This commit is contained in:
SebastianStork 2025-09-20 22:59:27 +02:00
parent d7d28fa19f
commit 387af935d1
4 changed files with 41 additions and 10 deletions

View file

@ -23,6 +23,7 @@ in
};
collect = {
hostMetrics = lib.mkEnableOption "";
victorialogsMetrics = lib.mkEnableOption "";
sshdLogs = lib.mkEnableOption "";
};
};
@ -56,10 +57,10 @@ in
}
'';
"alloy/node-exporter.alloy" = lib.mkIf cfg.collect.hostMetrics {
"alloy/host-metrics.alloy" = lib.mkIf cfg.collect.hostMetrics {
text = ''
prometheus.exporter.unix "default" {
enable_collectors = [ "systemd" ]
enable_collectors = ["systemd"]
}
prometheus.scrape "node_exporter" {
@ -70,6 +71,18 @@ in
'';
};
"alloy/victorialogs-metrics.alloy" = lib.mkIf cfg.collect.victorialogsMetrics {
text = ''
prometheus.scrape "victorialogs" {
targets = [{
__address__ = "localhost:${builtins.toString config.custom.services.victorialogs.port}",
}]
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "15s"
}
'';
};
"alloy/sshd-logs.alloy" = lib.mkIf cfg.collect.sshdLogs {
text = ''
loki.source.journal "sshd" {