2023-06-03 00:33:51 +02:00
|
|
|
{ config, lib, ... }:
|
2022-08-03 23:36:11 +02:00
|
|
|
|
2023-05-09 23:13:30 +02:00
|
|
|
let
|
|
|
|
nodeFor = nodeType: builtins.head config.services.monitoring.nodes.${nodeType};
|
|
|
|
|
|
|
|
meshIpFor = nodeType: config.vars.mesh.${nodeFor nodeType}.meshIp;
|
2023-06-03 00:33:51 +02:00
|
|
|
|
|
|
|
meshIpForNode = name: config.vars.mesh.${name}.meshIp;
|
2023-05-09 23:13:30 +02:00
|
|
|
in
|
|
|
|
|
2022-08-03 23:36:11 +02:00
|
|
|
{
|
2023-06-04 23:06:53 +02:00
|
|
|
imports = [
|
|
|
|
./options.nix
|
|
|
|
];
|
|
|
|
|
2022-08-03 23:36:11 +02:00
|
|
|
links = {
|
|
|
|
loki-ingest = {
|
|
|
|
protocol = "http";
|
2023-05-09 23:13:30 +02:00
|
|
|
ipv4 = meshIpFor "logging";
|
|
|
|
};
|
|
|
|
loki = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "logging";
|
2022-08-03 23:36:11 +02:00
|
|
|
};
|
2023-05-26 16:26:24 +02:00
|
|
|
prometheus-ingest = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
2023-06-03 01:00:58 +02:00
|
|
|
tempo = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
|
|
|
tempo-grpc = {
|
|
|
|
protocol = "http";
|
2023-11-04 03:22:20 +01:00
|
|
|
ipv4 = "127.0.0.1";
|
2023-06-03 01:00:58 +02:00
|
|
|
};
|
2023-06-02 17:35:53 +02:00
|
|
|
tempo-otlp-http = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
|
|
|
tempo-otlp-grpc = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
2023-11-04 03:59:17 +01:00
|
|
|
tempo-zipkin-http = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
2022-08-03 23:36:11 +02:00
|
|
|
};
|
2023-06-03 00:33:51 +02:00
|
|
|
hostLinks = lib.genAttrs config.services.monitoring.nodes.grafana (name: {
|
|
|
|
grafana = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpForNode name;
|
|
|
|
};
|
|
|
|
});
|
2022-08-03 23:36:11 +02:00
|
|
|
services.monitoring = {
|
|
|
|
nodes = {
|
2023-11-04 01:24:34 +01:00
|
|
|
client = [ "checkmate" "grail" "thunderskin" "VEGAS" "prophet" ];
|
2023-11-05 00:12:19 +01:00
|
|
|
blackbox = [ "checkmate" "grail" "prophet" ];
|
2023-06-03 00:33:51 +02:00
|
|
|
grafana = [ "VEGAS" "prophet" ];
|
2023-05-09 23:13:30 +02:00
|
|
|
logging = [ "VEGAS" ];
|
|
|
|
server = [ "VEGAS" ];
|
2022-08-03 23:36:11 +02:00
|
|
|
};
|
|
|
|
nixos = {
|
|
|
|
client = ./client.nix;
|
2023-05-27 13:44:31 +02:00
|
|
|
blackbox = ./blackbox.nix;
|
2023-06-03 00:33:51 +02:00
|
|
|
grafana = ./grafana-ha.nix;
|
2023-05-09 23:13:30 +02:00
|
|
|
logging = ./logging.nix;
|
|
|
|
server = [
|
|
|
|
./server.nix
|
|
|
|
./tracing.nix
|
2023-06-01 00:12:31 +02:00
|
|
|
./provisioning/dashboards.nix
|
2023-05-09 23:13:30 +02:00
|
|
|
];
|
2022-08-03 23:36:11 +02:00
|
|
|
};
|
|
|
|
};
|
2023-11-02 23:15:09 +01:00
|
|
|
|
2023-11-06 20:53:06 +01:00
|
|
|
garage = {
|
|
|
|
keys = {
|
|
|
|
loki = { };
|
|
|
|
tempo = { };
|
|
|
|
};
|
|
|
|
buckets = {
|
|
|
|
loki-chunks.allow.loki = [ "read" "write" ];
|
|
|
|
tempo-chunks.allow.tempo = [ "read" "write" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-04 17:31:59 +02:00
|
|
|
ways.monitoring = {
|
|
|
|
consulService = "grafana";
|
|
|
|
extras.locations."/".proxyWebsockets = true;
|
|
|
|
};
|
2022-08-03 23:36:11 +02:00
|
|
|
}
|