aboutsummaryrefslogtreecommitdiff
path: root/hosts/sagittarius/web/observability.nix
diff options
context:
space:
mode:
authorIsabella Bastaja <isabella@sorre.xyz>2026-05-23 18:25:27 +0200
committerIsabella Bastaja <isabella@sorre.xyz>2026-05-23 18:25:40 +0200
commit5e47a38f855c1468e88ec31954cc98cf4a5eff90 (patch)
treeef8f2edda1e6f49af3bb03c7524f24a371f3288f /hosts/sagittarius/web/observability.nix
parent2b201fe8d392549d2d9e5926b4d0456c81714ab0 (diff)
sagittarius: remove observability and matrix modules
Diffstat (limited to 'hosts/sagittarius/web/observability.nix')
-rw-r--r--hosts/sagittarius/web/observability.nix183
1 files changed, 0 insertions, 183 deletions
diff --git a/hosts/sagittarius/web/observability.nix b/hosts/sagittarius/web/observability.nix
deleted file mode 100644
index f622822..0000000
--- a/hosts/sagittarius/web/observability.nix
+++ /dev/null
@@ -1,183 +0,0 @@
-{ config, ... }:
-let
- otel-prometheus-exporter-port = 4316;
-
- grafana-cfg = config.services.grafana;
- prometheus-cfg = config.services.prometheus;
- # clickhouse-cfg = config.services.clickhouse;
-in
-{
- services.opentelemetry-collector = {
- enable = true;
- settings = {
- receivers = {
- otlp = {
- protocols = {
- grpc.endpoint = "localhost:4317";
- http.endpoint = "localhost:4318";
- };
- };
- hostmetrics.scrapers = {
- cpu = { };
- disk = { };
- filesystem = { };
- load = { };
- memory = { };
- network = { };
- process = { };
- processes = { };
- paging = { };
- };
- };
- processors = {
- memory_limiter = {
- check_interval = "5s";
- limit_mib = 2500;
- spike_limit_mib = 500;
- };
- batch = {
- timeout = "10s";
- send_batch_size = 100;
- };
- };
- exporters = {
- debug = {
- verbosity = "detailed";
- };
- prometheus = {
- endpoint = "localhost:${toString otel-prometheus-exporter-port}";
- send_timestamps = true;
- enable_open_metrics = true;
- };
- # clickhouse = {
- # endpoint = "tcp://localhost:${toString clickhouse-cfg.serverConfig.tcp_port}";
- # database = "otel";
- # username = "otel";
- # password = "";
- # async_insert = true;
- # ttl = "72h";
- # compress = "lz4";
- # create_schema = true;
- # logs_table_name = "otel_logs";
- # traces_table_name = "otel_traces";
- # timeout = "5s";
- # metrics_tables = {
- # gauge.name = "otel_metrics_gauge";
- # sum.name = "otel_metrics_sum";
- # summary.name = "otel_metrics_summary";
- # histogram.name = "otel_metrics_histogram";
- # exponential_histogram.name = "otel_metrics_exp_histogram";
- # };
- # retry_on_failure = {
- # enabled = true;
- # initial_interval = "5s";
- # max_interval = "30s";
- # max_elapsed_time = "300s";
- # };
- # };
- };
- service = {
- extensions = [ ];
- pipelines = {
- traces = {
- receivers = [ "otlp" ];
- exporters = [
- "debug"
- # "clickhouse"
- ];
- };
- metrics = {
- receivers = [
- "otlp"
- "hostmetrics"
- ];
- exporters = [
- "debug"
- "prometheus"
- # "clickhouse"
- ];
- };
- logs = {
- receivers = [ "otlp" ];
- exporters = [
- "debug"
- # "clickhouse"
- ];
- };
- };
- };
- };
- };
-
- services.prometheus = {
- enable = true;
- globalConfig = {
- scrape_timeout = "10s";
- scrape_interval = "1m";
- };
- scrapeConfigs = [
- {
- job_name = "otel";
- scrape_interval = "5s";
- static_configs = [
- {
- targets = [ "localhost:${toString otel-prometheus-exporter-port}" ];
- }
- ];
- }
- ];
- };
-
- services.grafana = {
- enable = true;
- settings = {
- server = {
- http_addr = "127.0.0.1";
- http_port = 9001;
- domain = "grafana.sorre.xyz";
- root_url = "https://grafana.sorre.xyz/";
- serve_from_sub_path = true;
- };
- };
- provision = {
- enable = true;
- datasources.settings = {
- prune = true;
- datasources = [
- {
- type = "prometheus";
- name = "prometheus";
- url = "http://localhost:${toString prometheus-cfg.port}";
- }
- ];
- };
- };
- };
-
- # services.clickhouse = {
- # enable = true;
- # # NOTE: manually created the "otel" user and database
- # serverConfig = {
- # http_port = 8123;
- # tcp_port = 9000;
- # };
- # };
-
- services.nginx.virtualHosts."grafana.sorre.xyz" = {
- forceSSL = true;
- enableACME = true;
- locations."/" =
- let
- proxyPass =
- "http://"
- + (toString grafana-cfg.settings.server.http_addr)
- + ":"
- + (toString grafana-cfg.settings.server.http_port);
- in
- {
- inherit proxyPass;
- proxyWebsockets = true;
- recommendedProxySettings = true;
- };
- };
-}