From 6ecd2101300cc7aa374159cfdc4086029c5c2d33 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 26 May 2023 16:26:24 +0200 Subject: [PATCH] cluster/services/monitoring: make Prometheus accessible in host mesh --- cluster/services/monitoring/default.nix | 4 ++++ cluster/services/monitoring/server.nix | 9 ++++----- cluster/services/monitoring/tracing.nix | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cluster/services/monitoring/default.nix b/cluster/services/monitoring/default.nix index 1bd66b4..37f9dd6 100644 --- a/cluster/services/monitoring/default.nix +++ b/cluster/services/monitoring/default.nix @@ -16,6 +16,10 @@ in protocol = "http"; ipv4 = meshIpFor "logging"; }; + prometheus-ingest = { + protocol = "http"; + ipv4 = meshIpFor "server"; + }; }; services.monitoring = { nodes = { diff --git a/cluster/services/monitoring/server.nix b/cluster/services/monitoring/server.nix index bc7ac65..868245a 100644 --- a/cluster/services/monitoring/server.nix +++ b/cluster/services/monitoring/server.nix @@ -4,7 +4,7 @@ let inherit (config) links; - inherit (cluster.config.links) loki-ingest; + inherit (cluster.config.links) loki-ingest prometheus-ingest; iniList = lib.concatStringsSep " "; @@ -21,7 +21,6 @@ in links = { grafana.protocol = "http"; - prometheus.protocol = "http"; }; services.grafana = { enable = true; @@ -66,7 +65,7 @@ in { name = "Prometheus"; uid = "PBFA97CFB590B2093"; - inherit (links.prometheus) url; + inherit (prometheus-ingest) url; type = "prometheus"; isDefault = true; } @@ -90,8 +89,8 @@ in services.prometheus = { enable = true; - listenAddress = links.prometheus.ipv4; - inherit (links.prometheus) port; + listenAddress = prometheus-ingest.ipv4; + inherit (prometheus-ingest) port; extraFlags = [ "--enable-feature=remote-write-receiver" ]; globalConfig = { scrape_interval = "60s"; diff --git a/cluster/services/monitoring/tracing.nix b/cluster/services/monitoring/tracing.nix index 3325494..f180ff0 100644 --- a/cluster/services/monitoring/tracing.nix +++ b/cluster/services/monitoring/tracing.nix @@ -1,7 +1,8 @@ -{ config, pkgs, ... }: +{ cluster, config, pkgs, ... }: let inherit (config) links; + inherit (cluster.config.links) prometheus-ingest; dataDir = "/srv/storage/private/tempo"; tempoConfig = { server = { @@ -47,7 +48,7 @@ let path = "${dataDir}/generator/wal"; remote_write = [ { - url = "${links.prometheus.url}/api/v1/write"; + url = "${prometheus-ingest.url}/api/v1/write"; send_exemplars = true; } ];