This repository has been archived on 2024-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
infrastructure/hosts/pink/services/monitoring/prometheus.nix

80 lines
1.8 KiB
Nix
Raw Normal View History

2024-05-29 17:15:20 +02:00
{ pkgs, config, ... }:
let
lime = "32.54.31.241";
carbon = "32.54.31.180";
in
{
services.prometheus = {
enable = true;
scrapeConfigs = [
{
job_name = "node";
scrape_interval = "5s";
static_configs = [
{
targets = [ "localhost:9001" ];
labels = { alias = "node.pink.local"; };
}
{
targets = [ "${carbon}:9001" ];
labels = { alias = "node.carbon.local"; };
}
{
targets = [ "${lime}:9001" ];
labels = { alias = "node.lime.local"; };
}
{
targets = [ "32.54.31.172:9001" ];
labels = { alias = "node.strix.local"; };
}
];
}
{
job_name = "smartmontools";
scrape_interval = "5s";
static_configs = [
{
targets = [ "localhost:9633" ];
labels = { alias = "smartctl.pink.local"; };
}
{
targets = [ "${lime}:9633" ];
labels = { alias = "smartctl.lime.local"; };
}
{
targets = [ "${carbon}:9633" ];
labels = { alias = "smartctl.carbon.local"; };
}
];
}
{
job_name = "endlessh";
scrape_interval = "5s";
static_configs = [
{
targets = [ "localhost:${toString config.services.endlessh-go.prometheus.port}" ];
labels = { alias = "endlessh.pink.local"; };
}
];
}
{
job_name = "i2p";
scrape_interval = "5s";
static_configs = [
{
targets = [ "localhost:${toString config.services.prometheus.exporters.i2pd.port}" ];
labels = { alias = "i2pd.pink.local"; };
}
];
}
];
};
}