more monitoring

This commit is contained in:
chris 2025-03-19 23:13:43 +01:00
parent 5d7d2c7e94
commit 80509191ae
Signed by: c6ristian
SSH key fingerprint: SHA256:B3m+yzpaxGXSEcDBpPHfvza/DNC0wuX+CKMeGq8wgak
3 changed files with 34 additions and 22 deletions
modules
systems/monitoring.noc.eh22.intern

View file

@ -8,16 +8,16 @@
{
sops = {
secrets."services/loki/basic_auth" = {
mode = "0444";
owner = "nobody";
group = "nobody";
mode = "0440";
owner = "alloy";
group = "alloy";
restartUnits = [ "alloy.service" ];
sopsFile = ../secrets/passwords.yaml;
};
secrets."services/mimir/basic_auth" = {
mode = "0444";
owner = "nobody";
group = "nobody";
mode = "0440";
owner = "alloy";
group = "alloy";
restartUnits = [ "alloy.service" ];
sopsFile = ../secrets/passwords.yaml;
};
@ -27,6 +27,18 @@
enable = true;
};
users = {
users.alloy = {
isSystemUser = true;
group = "alloy";
};
groups.alloy = { };
};
systemd.services."alloy".serviceConfig = {
DynamicUser = lib.mkForce false;
};
environment.etc."alloy/config.alloy" = {
text = ''
prometheus.remote_write "default" {
@ -81,8 +93,7 @@
}
logging {
level = "warn"
format = "logfmt"
level = "info"
}
prometheus.exporter.unix "local_system" { }

View file

@ -62,13 +62,19 @@ in
instance_addr = "127.0.0.1";
};
};
ruler = {
ring = {
instance_addr = "127.0.0.1";
};
};
ruler_storage = {
backend = "local";
local.directory = alerts;
};
memberlist = {
bind_addr = ["127.0.0.1"];
bind_addr = [ "127.0.0.1" ];
};
};
};

View file

@ -30,29 +30,24 @@
environment.etc."alloy/pve.alloy" = {
text = ''
prometheus.scrape "example" {
// Collect metrics from the default listen address.
prometheus.scrape "noc_pve" {
targets = [{
__address__ = "127.0.0.1:9221",
__scheme__ = "http",
__metrics_path__ = "pve",
__param_target__ = "94.45.255.1",
}]
metrics_path = "/pve"
params = {
"target" = ["94.45.255.1"],
"module" = ["default"],
}
scrape_interval = "10s"
forward_to = [prometheus.relabel.pve.receiver]
}
prometheus.relabel "pve" {
forward_to = [prometheus.remote_write.default.receiver]
rule {
source_labels = [ "__param_target" ]
target_label = "instance"
}
rule {
target_label = "__address__"
replacement = "pve-exporter"
}
}
'';
};