2023-06-03 01:33:51 +03:00
|
|
|
{ config, lib, ... }:
|
2022-08-04 00:36:11 +03:00
|
|
|
|
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;
|
2023-06-03 01:33:51 +03:00
|
|
|
|
|
|
|
meshIpForNode = name: config.vars.mesh.${name}.meshIp;
|
2023-05-10 00:13:30 +03:00
|
|
|
in
|
|
|
|
|
2022-08-04 00:36:11 +03:00
|
|
|
{
|
2023-06-05 00:06:53 +03:00
|
|
|
imports = [
|
|
|
|
./options.nix
|
|
|
|
];
|
|
|
|
|
2022-08-04 00:36:11 +03:00
|
|
|
links = {
|
|
|
|
loki-ingest = {
|
|
|
|
protocol = "http";
|
2023-05-10 00:13:30 +03:00
|
|
|
ipv4 = meshIpFor "logging";
|
|
|
|
};
|
|
|
|
loki = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "logging";
|
2022-08-04 00:36:11 +03:00
|
|
|
};
|
2023-05-26 17:26:24 +03:00
|
|
|
prometheus-ingest = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
2023-06-03 02:00:58 +03:00
|
|
|
tempo = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
|
|
|
tempo-grpc = {
|
|
|
|
protocol = "http";
|
2023-11-04 04:22:20 +02:00
|
|
|
ipv4 = "127.0.0.1";
|
2023-06-03 02:00:58 +03:00
|
|
|
};
|
2023-06-02 18:35:53 +03:00
|
|
|
tempo-otlp-http = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
|
|
|
tempo-otlp-grpc = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpFor "server";
|
|
|
|
};
|
2022-08-04 00:36:11 +03:00
|
|
|
};
|
2023-06-03 01:33:51 +03:00
|
|
|
hostLinks = lib.genAttrs config.services.monitoring.nodes.grafana (name: {
|
|
|
|
grafana = {
|
|
|
|
protocol = "http";
|
|
|
|
ipv4 = meshIpForNode name;
|
|
|
|
};
|
|
|
|
});
|
2022-08-04 00:36:11 +03:00
|
|
|
services.monitoring = {
|
|
|
|
nodes = {
|
2023-11-04 02:24:34 +02:00
|
|
|
client = [ "checkmate" "grail" "thunderskin" "VEGAS" "prophet" ];
|
2023-05-27 14:44:31 +03:00
|
|
|
blackbox = [ "checkmate" "VEGAS" "prophet" ];
|
2023-06-03 01:33:51 +03:00
|
|
|
grafana = [ "VEGAS" "prophet" ];
|
2023-05-10 00:13:30 +03:00
|
|
|
logging = [ "VEGAS" ];
|
|
|
|
server = [ "VEGAS" ];
|
2022-08-04 00:36:11 +03:00
|
|
|
};
|
|
|
|
nixos = {
|
|
|
|
client = ./client.nix;
|
2023-05-27 14:44:31 +03:00
|
|
|
blackbox = ./blackbox.nix;
|
2023-06-03 01:33:51 +03:00
|
|
|
grafana = ./grafana-ha.nix;
|
2023-05-10 00:13:30 +03:00
|
|
|
logging = ./logging.nix;
|
|
|
|
server = [
|
|
|
|
./server.nix
|
|
|
|
./tracing.nix
|
2023-06-01 01:12:31 +03:00
|
|
|
./provisioning/dashboards.nix
|
2023-05-10 00:13:30 +03:00
|
|
|
];
|
2022-08-04 00:36:11 +03:00
|
|
|
};
|
|
|
|
};
|
2023-11-03 00:15:09 +02:00
|
|
|
|
|
|
|
dns.records.monitoring.consulService = "grafana";
|
2022-08-04 00:36:11 +03:00
|
|
|
}
|