mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
grafana: Add victorialogs dashboard
This commit is contained in:
parent
d7d28fa19f
commit
387af935d1
4 changed files with 41 additions and 10 deletions
|
|
@ -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" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue