services/monitoring: enable node graph and service graph

This commit is contained in:
Max Headroom 2022-06-18 23:24:12 +02:00
parent b39418084f
commit 60fca938fb
2 changed files with 30 additions and 0 deletions

View file

@ -82,12 +82,15 @@ in
datasources = [ datasources = [
{ {
name = "Prometheus"; name = "Prometheus";
# wait for https://github.com/NixOS/nixpkgs/pull/175330
# uid = "PBFA97CFB590B2093";
inherit (links.prometheus) url; inherit (links.prometheus) url;
type = "prometheus"; type = "prometheus";
isDefault = true; isDefault = true;
} }
{ {
name = "Loki"; name = "Loki";
# uid = "P8E80F9AEF21F6940";
inherit (links.loki) url; inherit (links.loki) url;
type = "loki"; type = "loki";
} }
@ -107,6 +110,7 @@ in
enable = true; enable = true;
listenAddress = links.prometheus.ipv4; listenAddress = links.prometheus.ipv4;
inherit (links.prometheus) port; inherit (links.prometheus) port;
extraFlags = [ "--enable-feature=remote-write-receiver" ];
globalConfig = { globalConfig = {
scrape_interval = "60s"; scrape_interval = "60s";
}; };

View file

@ -5,6 +5,7 @@ let
dataDir = "/srv/storage/private/tempo"; dataDir = "/srv/storage/private/tempo";
tempoConfig = { tempoConfig = {
search_enabled = true; search_enabled = true;
metrics_generator_enabled = true;
server = { server = {
http_listen_address = links.tempo.ipv4; http_listen_address = links.tempo.ipv4;
http_listen_port = links.tempo.port; http_listen_port = links.tempo.port;
@ -44,6 +45,25 @@ let
queue_depth = 1000; queue_depth = 1000;
}; };
}; };
metrics_generator = {
registry.external_labels = {
source = "tempo";
host = config.networking.hostName;
};
storage = {
path = "${dataDir}/generator/wal";
remote_write = [
{
url = "${links.prometheus.url}/api/v1/write";
send_exemplars = true;
}
];
};
};
overrides.metrics_generator_processors = [
"service-graphs"
"span-metrics"
];
}; };
in { in {
links = { links = {
@ -74,8 +94,14 @@ in {
services.grafana.provision.datasources = [ services.grafana.provision.datasources = [
{ {
name = "Tempo"; name = "Tempo";
# wait for https://github.com/NixOS/nixpkgs/pull/175330
# uid = "P214B5B846CF3925F";
inherit (links.tempo) url; inherit (links.tempo) url;
type = "tempo"; type = "tempo";
jsonData = {
serviceMap.datasourceUid = "PBFA97CFB590B2093"; # prometheus
nodeGraph.enabled = true;
};
} }
]; ];
} }