more monitoring
This commit is contained in:
parent
5d7d2c7e94
commit
80509191ae
3 changed files with 34 additions and 22 deletions
|
@ -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" { }
|
||||
|
|
|
@ -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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue