mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-23 17:35:38 +02:00
service/grafana: add monitoring
This commit is contained in:
parent
ffd5c8b5c1
commit
db8924bcc2
3 changed files with 1318 additions and 1 deletions
|
@ -47,7 +47,32 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
provision.enable = true;
|
||||
provision = {
|
||||
enable = true;
|
||||
dashboards.settings.providers = [
|
||||
{
|
||||
name = "Grafana";
|
||||
options.path = pkgs.grafana-dashboards.grafana;
|
||||
disableDeletion = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.prometheus = {
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "grafana";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "127.0.0.1:${toString cfg.port}" ];
|
||||
labels = {
|
||||
instance = config.networking.hostName;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
my.services.nginx.virtualHosts = [
|
||||
|
|
|
@ -63,4 +63,11 @@ in
|
|||
}).overrideAttrs (self: super: {
|
||||
src = ./gitea.json; # sadly not yet updated to latest grafana
|
||||
});
|
||||
grafana = (buildGrafanaDashboard {
|
||||
id = 3590;
|
||||
pname = "grafana";
|
||||
version = "3";
|
||||
}).overrideAttrs (self: super: {
|
||||
src = ./grafana.json; # sadly only imported dashboards work
|
||||
});
|
||||
})
|
||||
|
|
1285
pkgs/grafana-dashboards/grafana.json
Normal file
1285
pkgs/grafana-dashboards/grafana.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue