sakura: init basic grafana / prometheus
This commit is contained in:
parent
919d2af886
commit
817927b7e2
4 changed files with 67 additions and 0 deletions
|
@ -9,5 +9,7 @@
|
|||
./forgejo.nix
|
||||
./jellyfin.nix
|
||||
./rustypaste.nix
|
||||
./grafana.nix
|
||||
./prometheus.nix
|
||||
];
|
||||
}
|
||||
|
|
34
hosts/sakura/services/grafana.nix
Normal file
34
hosts/sakura/services/grafana.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{...}: {
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
root_url = "https://metrics.notohh.dev";
|
||||
domain = "metrics.notohh.dev";
|
||||
enforce_domain = true;
|
||||
http_addr = "0.0.0.0";
|
||||
http_port = 3100;
|
||||
};
|
||||
auth = {
|
||||
disable_login_form = false;
|
||||
};
|
||||
users = {
|
||||
allow_signup = false;
|
||||
auto_assign_org = true;
|
||||
auto_assign_org_role = "Viewer";
|
||||
};
|
||||
};
|
||||
provision = {
|
||||
datasources.settings = {
|
||||
datasources = [
|
||||
{
|
||||
name = "Prometheus";
|
||||
type = "prometheus";
|
||||
url = "http://127.0.0.0:9090";
|
||||
orgId = 1;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
23
hosts/sakura/services/prometheus.nix
Normal file
23
hosts/sakura/services/prometheus.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{...}: {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "prometheus";
|
||||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["127.0.0.0:9090"];}];
|
||||
}
|
||||
{
|
||||
job_name = "node";
|
||||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["127.0.0.0:9100"];}];
|
||||
}
|
||||
];
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
enabledCollectors = ["systemd" "cpu"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -68,6 +68,13 @@
|
|||
tls.domains = [{main = "*.notohh.dev";}];
|
||||
tls.certresolver = "production";
|
||||
};
|
||||
grafana = {
|
||||
rule = "Host(`metrics.notohh.dev`)";
|
||||
entrypoints = ["websecure"];
|
||||
service = "grafana";
|
||||
tls.domains = [{main = "*.notohh.dev";}];
|
||||
tls.certresolver = "production";
|
||||
};
|
||||
};
|
||||
services = {
|
||||
homepage.loadBalancer.servers = [{url = "http://localhost:3005";}];
|
||||
|
@ -78,6 +85,7 @@
|
|||
foundryvtt.loadBalancer.servers = [{url = "http://localhost:30000";}];
|
||||
gitea.loadBalancer.servers = [{url = "http://localhost:3000";}];
|
||||
rustypaste.loadBalancer.servers = [{url = "http://localhost:8000";}];
|
||||
grafana.loadBalancer.servers = [{url = "http://localhost:3100";}];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue