depot/cluster/services/monitoring/default.nix

73 lines
1.5 KiB
Nix
Raw Normal View History

{ config, lib, ... }:
2023-05-10 00:13:30 +03:00
let
nodeFor = nodeType: builtins.head config.services.monitoring.nodes.${nodeType};
meshIpFor = nodeType: config.vars.mesh.${nodeFor nodeType}.meshIp;
meshIpForNode = name: config.vars.mesh.${name}.meshIp;
2023-05-10 00:13:30 +03:00
in
{
imports = [
./options.nix
];
links = {
loki-ingest = {
protocol = "http";
2023-05-10 00:13:30 +03:00
ipv4 = meshIpFor "logging";
};
loki = {
protocol = "http";
ipv4 = meshIpFor "logging";
};
prometheus-ingest = {
protocol = "http";
ipv4 = meshIpFor "server";
};
tempo = {
protocol = "http";
ipv4 = meshIpFor "server";
};
tempo-grpc = {
protocol = "http";
ipv4 = meshIpFor "server";
};
tempo-otlp-http = {
protocol = "http";
ipv4 = meshIpFor "server";
};
tempo-otlp-grpc = {
protocol = "http";
ipv4 = meshIpFor "server";
};
};
hostLinks = lib.genAttrs config.services.monitoring.nodes.grafana (name: {
grafana = {
protocol = "http";
ipv4 = meshIpForNode name;
};
});
services.monitoring = {
nodes = {
client = [ "checkmate" "thunderskin" "VEGAS" "prophet" ];
blackbox = [ "checkmate" "VEGAS" "prophet" ];
grafana = [ "VEGAS" "prophet" ];
2023-05-10 00:13:30 +03:00
logging = [ "VEGAS" ];
server = [ "VEGAS" ];
};
nixos = {
client = ./client.nix;
blackbox = ./blackbox.nix;
grafana = ./grafana-ha.nix;
2023-05-10 00:13:30 +03:00
logging = ./logging.nix;
server = [
./server.nix
./tracing.nix
./provisioning/dashboards.nix
2023-05-10 00:13:30 +03:00
];
};
};
}