aboutsummaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
authorIsabella Bastaja <isabella@sorre.xyz>2025-12-27 14:28:51 +0100
committerIsabella Bastaja <isabella@sorre.xyz>2025-12-29 19:01:53 +0100
commit8f14623812b999af68299ac060827bbf876fe285 (patch)
tree4f07bac656517c4154b5da9e4e7517e00a8e50a8 /hosts
parent1affb2c57359c9604e53c0d00abaecfab0126eef (diff)
sagittarius: clickhouse hello world
also move grafana to subdomain
Diffstat (limited to 'hosts')
-rw-r--r--hosts/sagittarius/web/observability.nix45
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;
+ };
};
}