2024-07-29 22:55:37 +02:00
|
|
|
{config, ...}: let
|
|
|
|
vmcfg = config.services.victoriametrics;
|
|
|
|
pmcfg = config.services.prometheus;
|
|
|
|
in {
|
2024-07-20 14:28:40 +02:00
|
|
|
cfTunnels."grafana.uku3lig.net" = "http://localhost:2432";
|
|
|
|
|
|
|
|
services.grafana = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
http_port = 2432;
|
|
|
|
root_url = "https://grafana.uku3lig.net";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-29 22:55:37 +02:00
|
|
|
services.victoriametrics = {
|
2024-07-20 14:28:40 +02:00
|
|
|
enable = true;
|
2024-07-29 22:55:37 +02:00
|
|
|
listenAddress = "127.0.0.1:9090";
|
|
|
|
retentionPeriod = 5 * 12; # 5 years !!!!
|
|
|
|
};
|
2024-07-20 14:28:40 +02:00
|
|
|
|
2024-07-29 22:55:37 +02:00
|
|
|
services.vmagent = {
|
|
|
|
enable = true;
|
|
|
|
remoteWrite.url = "http://${vmcfg.listenAddress}/api/v1/write";
|
|
|
|
prometheusConfig = {
|
|
|
|
global.scrape_interval = "15s";
|
2024-07-20 14:28:40 +02:00
|
|
|
|
2024-07-29 22:55:37 +02:00
|
|
|
scrape_configs = [
|
|
|
|
{
|
|
|
|
job_name = "node";
|
|
|
|
static_configs = [{targets = ["localhost:${builtins.toString pmcfg.exporters.node.port}"];}];
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
job_name = "victoriametrics";
|
|
|
|
static_configs = [{targets = ["${builtins.toString vmcfg.listenAddress}"];}];
|
|
|
|
}
|
2024-07-20 14:28:40 +02:00
|
|
|
|
2024-07-29 22:55:37 +02:00
|
|
|
{
|
|
|
|
job_name = "api-rs";
|
|
|
|
static_configs = [{targets = ["localhost:5001"];}];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-07-20 14:28:40 +02:00
|
|
|
};
|
|
|
|
}
|