feat(self_host/monitoring): adding the reproductible dashboard config
- Using assets for more simplicities
This commit is contained in:
parent
3115fbb41c
commit
3b3e2c9b57
1 changed files with 34 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
let
|
||||
cfg = config.service.selfhost.monitor;
|
||||
dashboardsDir = ../../assets/grafana_dashboards;
|
||||
monitored = [
|
||||
"nginx"
|
||||
"grafana"
|
||||
|
|
@ -18,7 +19,36 @@ in
|
|||
enable = true;
|
||||
package = pkgs.grafana;
|
||||
dataDir = "/var/lib/grafana";
|
||||
provision = {
|
||||
dashboards.settings.providers = [
|
||||
{
|
||||
name = "nixos-dashboards";
|
||||
type = "file";
|
||||
updateIntervalSeconds = 30;
|
||||
editable = false;
|
||||
|
||||
options = {
|
||||
path = "/etc/grafana/dashboards";
|
||||
foldersFromFilesStructure = false;
|
||||
};
|
||||
}
|
||||
];
|
||||
datasources.settings.datasources = [
|
||||
{
|
||||
name = "Prometheus";
|
||||
type = "prometheus";
|
||||
uid = "prometheus";
|
||||
access = "proxy";
|
||||
url = "http://127.0.0.1:9090";
|
||||
isDefault = true;
|
||||
editable = false;
|
||||
jsonData = {
|
||||
httpMethod = "POST";
|
||||
timeInterval = "15s";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
settings = {
|
||||
server = {
|
||||
root_url = "https://monitor.enium.eu";
|
||||
|
|
@ -37,6 +67,8 @@ in
|
|||
};
|
||||
|
||||
security = {
|
||||
cookie_secure = true;
|
||||
cookie_samesite = "none";
|
||||
allow_embedding = true;
|
||||
};
|
||||
};
|
||||
|
|
@ -157,6 +189,8 @@ in
|
|||
ruleFiles = lib.mkForce [ "/etc/prometheus/services.rules" ];
|
||||
};
|
||||
|
||||
environment.etc."grafana/dashboards".source = dashboardsDir;
|
||||
|
||||
environment.etc."prometheus/services.rules".text = ''
|
||||
groups:
|
||||
- name: services
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue