nix-infra/common/fragments/grafana.nix

51 lines
1.3 KiB
Nix

{ config, ... }:
{
services.grafana = {
enable = true;
settings.server = {
domain = "grafana.technogothic.net";
http_port = 2342;
http_addr = "127.0.0.1";
};
settings."auth.anonymous" = {
enabled = true;
org_name = "Main Org.";
org_role = "Viewer";
};
};
networking.firewall.allowedTCPPorts = [ config.services.grafana.settings.server.http_port ];
services.prometheus = {
enable = true;
port = 9001;
retentionTime = "365d";
scrapeConfigs = [
{
job_name = "bloodletting";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }
];
}
{
job_name = "nginx";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.nginx.port}" ]; }
];
}
{
job_name = "telegraf";
static_configs = [
{ targets = [ config.services.telegraf.extraConfig.outputs.prometheus_client.listen ]; }
];
}
{
job_name = "process";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.process.port}" ]; }
];
}
];
};
}