cluster/services/monitoring: use grafana-agent integrated node_exporter

This commit is contained in:
Max Headroom 2023-05-26 17:30:36 +02:00
parent 6cff7460f6
commit 68ca309c93
2 changed files with 7 additions and 22 deletions

View file

@ -9,27 +9,19 @@ let
in {
services.journald.extraConfig = "Storage=volatile";
services.prometheus.exporters = {
node = {
enable = true;
listenAddress = myNode.meshIp;
enabledCollectors = [
"systemd"
];
};
};
systemd.services.prometheus-node-exporter = {
after = [ "wireguard-wgmesh.service" ];
serviceConfig.RestartSec = "10s";
};
services.grafana-agent = {
enable = true;
settings = {
metrics.global.remote_write = lib.singleton {
url = "${cluster.config.links.prometheus-ingest.url}/api/v1/write";
};
integrations.node_exporter = {
enabled = true;
instance = cluster.config.vars.hostName;
enable_collectors = [
"systemd"
];
};
logs.configs = lib.singleton {
name = "logging";
positions.filename = "\${STATE_DIRECTORY:/tmp}/logging-positions.yaml";

View file

@ -96,13 +96,6 @@ in
scrape_interval = "60s";
};
scrapeConfigs = [
{
job_name = "node";
static_configs = lib.flip lib.mapAttrsToList cluster.config.vars.mesh (name: host: {
targets = [ "${host.meshIp}:9100" ];
labels.instance = name;
});
}
{
job_name = "ipfs";
scheme = "https";