diff options
| author | Isabella Bastaja <isabella@sorre.xyz> | 2025-12-27 00:02:13 +0100 |
|---|---|---|
| committer | Isabella Bastaja <isabella@sorre.xyz> | 2025-12-27 00:04:39 +0100 |
| commit | 06156350ce60ec3a6120c3670b890b296f40c414 (patch) | |
| tree | 3d12934c3702c0cb4250e9de6e8b7ac9e580eaf1 /hosts | |
| parent | 5e7896eac4da3ba6ee0e42ec9dd27c1e3d8e011e (diff) | |
sagittarius: grafana hello world
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/sagittarius/web/observability.nix | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/hosts/sagittarius/web/observability.nix b/hosts/sagittarius/web/observability.nix index cebeac0..451ca58 100644 --- a/hosts/sagittarius/web/observability.nix +++ b/hosts/sagittarius/web/observability.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, ... }: let otel-prometheus-exporter-port = 4316; in @@ -90,4 +90,40 @@ in } ]; }; + + services.grafana = { + enable = true; + settings = { + server = { + http_addr = "127.0.0.1"; + http_port = 9001; + domain = "sorre.xyz"; + root_url = "https://sorre.xyz/grafana"; + serve_from_sub_path = true; + }; + }; + provision = { + enable = true; + datasources.settings = { + prune = true; + datasources = [ + { + type = "prometheus"; + name = "prometheus"; + url = "http://localhost:${toString config.services.prometheus.port}"; + } + ]; + }; + }; + }; + + services.nginx.virtualHosts."sorre.xyz" = { + forceSSL = true; + enableACME = true; + locations."/grafana/" = { + proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}"; + proxyWebsockets = true; + recommendedProxySettings = true; + }; + }; } |
