diff options
Diffstat (limited to 'hosts/sagittarius/web/observability.nix')
| -rw-r--r-- | hosts/sagittarius/web/observability.nix | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/hosts/sagittarius/web/observability.nix b/hosts/sagittarius/web/observability.nix index 451ca58..2315395 100644 --- a/hosts/sagittarius/web/observability.nix +++ b/hosts/sagittarius/web/observability.nix @@ -1,6 +1,9 @@ { config, ... }: let otel-prometheus-exporter-port = 4316; + + grafana-cfg = config.services.grafana; + prometheus-cfg = config.services.prometheus; in { services.opentelemetry-collector = { @@ -65,7 +68,9 @@ in }; logs = { receivers = [ "otlp" ]; - exporters = [ "debug" ]; + exporters = [ + "debug" + ]; }; }; }; @@ -110,20 +115,44 @@ in { type = "prometheus"; name = "prometheus"; - url = "http://localhost:${toString config.services.prometheus.port}"; + url = "http://localhost:${toString prometheus-cfg.port}"; } ]; }; }; }; - services.nginx.virtualHosts."sorre.xyz" = { + services.clickhouse = { + enable = true; + usersConfig = { + otel = { + profile = "analytics"; + password_sha256_hex = "bf07f7edecb3a2ee3e91f468964c1ef0e03d724d87af08fe8cec0552887b5b68"; + access_management = false; + default_database = "otel"; + }; + }; + serverConfig = { + http_port = 8123; + tcp_port = 9000; + }; + }; + + services.nginx.virtualHosts."grafana.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; - }; + locations."/grafana/" = + let + proxyPass = + "http://" + + (toString grafana-cfg.settings.server.http_addr) + + ":" + + (toString grafana-cfg.settings.server.http_port); + in + { + inherit proxyPass; + proxyWebsockets = true; + recommendedProxySettings = true; + }; }; } |
