Server/grafana: provision prometheus datasource

This commit is contained in:
Toast 2025-01-10 10:45:40 +01:00
parent 3d4deae65a
commit d65b4380e7
2 changed files with 16 additions and 1 deletions

View file

@ -23,6 +23,14 @@ in {
services = {
grafana = {
enable = true;
provision = {
enable = true;
datasources.settings = {
apiVersion = 1;
};
};
settings = {
analytics.reporting_enabled = false;
security = {

View file

@ -1,4 +1,4 @@
{...}: {
{config, ...}: {
services.prometheus = {
enable = true;
enableReload = true;
@ -21,4 +21,11 @@
}
];
};
services.grafana.provision = {
datasources.settings.datasources = [{
name = "Prometheus";
type = "prometheus";
url = "http://127.0.0.1:${builtins.toString config.services.prometheus.port}";
}];
};
}