Add grafana_metric module to system configs and provision Grafana datasources
This commit is contained in:
parent
7bbacc8512
commit
0270bbac6f
5 changed files with 64 additions and 1 deletions
|
|
@ -42,6 +42,7 @@ in {
|
||||||
(choose [./modules/local/hostname_username.nix ../local/hostname_username.nix])
|
(choose [./modules/local/hostname_username.nix ../local/hostname_username.nix])
|
||||||
(choose [./modules/local/networking_local.nix ../local/networking_local.nix])
|
(choose [./modules/local/networking_local.nix ../local/networking_local.nix])
|
||||||
(choose [./modules/lix-default.nix ../lix-default.nix])
|
(choose [./modules/lix-default.nix ../lix-default.nix])
|
||||||
|
(choose [./modules/toolsets/grafana_metric.nix ../toolsets/grafana_metric.nix])
|
||||||
(choose [./modules/secrets-config/sops-build-machine.nix ../secrets-config/sops-build-machine.nix])
|
(choose [./modules/secrets-config/sops-build-machine.nix ../secrets-config/sops-build-machine.nix])
|
||||||
## TODO: Make this more elegant and less risky for unexpected errors happening.
|
## TODO: Make this more elegant and less risky for unexpected errors happening.
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ in {
|
||||||
# Optionally: (choose [ ./modules/toolsets/remote_building.nix ../toolsets/remote_building.nix ])
|
# Optionally: (choose [ ./modules/toolsets/remote_building.nix ../toolsets/remote_building.nix ])
|
||||||
|
|
||||||
## Compose modules for Portainer service
|
## Compose modules for Portainer service
|
||||||
|
(choose [./modules/toolsets/grafana_metric.nix ../toolsets/grafana_metric.nix])
|
||||||
(choose [./modules/songsheet/wavelog/docker-compose.nix ../songsheet/wavelog/docker-compose.nix])
|
(choose [./modules/songsheet/wavelog/docker-compose.nix ../songsheet/wavelog/docker-compose.nix])
|
||||||
(choose [./modules/secrets-config/sops-composesongsheet.nix ../secrets-config/sops-composesongsheet.nix])
|
(choose [./modules/secrets-config/sops-composesongsheet.nix ../secrets-config/sops-composesongsheet.nix])
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ in {
|
||||||
(choose [./modules/local/networking_local.nix ../local/networking_local.nix])
|
(choose [./modules/local/networking_local.nix ../local/networking_local.nix])
|
||||||
(choose [./modules/bootloader/seabios-assigned-iso-at-birth.nix ../bootloader/seabios-assigned-iso-at-birth.nix])
|
(choose [./modules/bootloader/seabios-assigned-iso-at-birth.nix ../bootloader/seabios-assigned-iso-at-birth.nix])
|
||||||
(choose [./modules/lix-default.nix ../lix-default.nix])
|
(choose [./modules/lix-default.nix ../lix-default.nix])
|
||||||
|
(choose [./modules/toolsets/grafana_metric.nix ../toolsets/grafana_metric.nix])
|
||||||
(choose [./modules/secrets-config/sops-database.nix ../secrets-config/sops-database.nix])
|
(choose [./modules/secrets-config/sops-database.nix ../secrets-config/sops-database.nix])
|
||||||
(choose [./modules/system_scripts/gcloud_backup.nix ../system_scripts/gcloud_backup.nix])
|
(choose [./modules/system_scripts/gcloud_backup.nix ../system_scripts/gcloud_backup.nix])
|
||||||
## TODO: Make this more elegant and less risky for unexpected errors happening.
|
## TODO: Make this more elegant and less risky for unexpected errors happening.
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ in {
|
||||||
(choose [./modules/toolsets/remote_building.nix ../toolsets/remote_building.nix])
|
(choose [./modules/toolsets/remote_building.nix ../toolsets/remote_building.nix])
|
||||||
(choose [./modules/bootloader/seabios-assigned-proxmox-at-birth.nix ../bootloader/seabios-assigned-proxmox-at-birth.nix])
|
(choose [./modules/bootloader/seabios-assigned-proxmox-at-birth.nix ../bootloader/seabios-assigned-proxmox-at-birth.nix])
|
||||||
(choose [./modules/lix-default.nix ../lix-default.nix])
|
(choose [./modules/lix-default.nix ../lix-default.nix])
|
||||||
|
(choose [./modules/toolsets/grafana_metric.nix ../toolsets/grafana_metric.nix])
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,65 @@ in {
|
||||||
# Prevents Grafana from phoning home
|
# Prevents Grafana from phoning home
|
||||||
#analytics.reporting_enabled = false;
|
#analytics.reporting_enabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
provision = {
|
||||||
|
enable = true;
|
||||||
|
# ============== Declarative Config ================
|
||||||
|
|
||||||
|
datasources.settings.datasources = [
|
||||||
|
# Provisioning a built-in data source
|
||||||
|
{
|
||||||
|
name = "Prometheus - Forgejo";
|
||||||
|
type = "prometheus";
|
||||||
|
url = "http://10.1.1.4:9001";
|
||||||
|
isDefault = false;
|
||||||
|
editable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "Loki - Forgejo";
|
||||||
|
type = "loki";
|
||||||
|
url = "http://10.1.1.4:3100";
|
||||||
|
isDefault = false;
|
||||||
|
editable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "Prometheus - Build Machine";
|
||||||
|
type = "prometheus";
|
||||||
|
url = "http://10.1.1.3:9001";
|
||||||
|
isDefault = false;
|
||||||
|
editable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "Loki - Build Machine";
|
||||||
|
type = "loki";
|
||||||
|
url = "http://10.1.1.3:3100";
|
||||||
|
isDefault = false;
|
||||||
|
editable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "Prometheus - Database";
|
||||||
|
type = "prometheus";
|
||||||
|
url = "http://10.1.1.251:9001";
|
||||||
|
isDefault = false;
|
||||||
|
editable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "Loki - Database";
|
||||||
|
type = "loki";
|
||||||
|
url = "http://10.1.1.251:3100";
|
||||||
|
isDefault = false;
|
||||||
|
editable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
|
|
@ -218,6 +277,6 @@ in {
|
||||||
networking.firewall.allowedTCPPorts = [3000];
|
networking.firewall.allowedTCPPorts = [3000];
|
||||||
networking.firewall.allowedUDPPorts = [3000];
|
networking.firewall.allowedUDPPorts = [3000];
|
||||||
|
|
||||||
# ============== Declarative Config ================
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue