cluster/services/monitoring: make Prometheus accessible in host mesh

This commit is contained in:
Max Headroom 2023-05-26 16:26:24 +02:00
parent c4d2a13912
commit 6ecd210130
3 changed files with 11 additions and 7 deletions

View file

@ -16,6 +16,10 @@ in
protocol = "http";
ipv4 = meshIpFor "logging";
};
prometheus-ingest = {
protocol = "http";
ipv4 = meshIpFor "server";
};
};
services.monitoring = {
nodes = {

View file

@ -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";

View file

@ -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;
}
];