service/prometheus: move datasource config from grafana

This commit is contained in:
Felix Buehler 2023-04-09 23:06:38 +02:00
parent f16141a060
commit 879f642f40
2 changed files with 20 additions and 20 deletions

View file

@ -47,19 +47,7 @@ in
};
};
provision = {
enable = true;
datasources.settings.datasources = [
(lib.optionalAttrs config.services.prometheus.enable {
name = "Prometheus";
type = "prometheus";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
jsonData = {
timeInterval = config.services.prometheus.globalConfig.scrape_interval;
};
})
];
};
provision.enable = true;
};
my.services.nginx.virtualHosts = [

View file

@ -61,13 +61,25 @@ in
];
};
services.grafana.provision.dashboards.settings.providers = [
services.grafana.provision = {
datasources.settings.datasources = [
{
name = "Prometheus";
type = "prometheus";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
jsonData = {
timeInterval = config.services.prometheus.globalConfig.scrape_interval;
};
}
];
dashboards.settings.providers = [
{
name = "Node Exporter";
options.path = pkgs.node-exporter-dashboard;
disableDeletion = true;
}
];
};
my.services.nginx.virtualHosts = [
{