1
0
Fork 0
forked from fi/nix-infra

Add metrics host with Grafana and Prometheus

This commit is contained in:
fi 2023-08-07 00:58:45 +02:00
commit d625f3f887
Signed by: fi
SSH key fingerprint: SHA256:d+6fQoDPMbSFK95zRVflRKZLRKF4cPSQb7VIxYkhFsA
6 changed files with 36 additions and 10 deletions

View file

@ -1,11 +1,11 @@
{ ... }:
{ config, ... }:
{
services.grafana = {
enable = true;
settings = {
server = {
domain = "grafana2.grzb.de";
root_url = "https://grafana2.grzb.de";
domain = "grafana.grzb.de";
root_url = "https://${config.services.grafana.settings.server.domain}";
};
security = {
cookie_secure = true;
@ -24,5 +24,13 @@
startTLS_policy = "NoStartTLS";
};
};
provision.datasources.settings.datasources = [
{
name = "Prometheus";
type = "prometheus";
url = "http://localhost:${builtins.toString config.services.prometheus.port}";
isDefault = true;
}
];
};
}