about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-12-04T20·21+0200
committerclbot <clbot@tvl.fyi>2024-12-04T22·37+0000
commit856886f01d64ebfe8e4602bcce842f555edb1bed (patch)
tree2f8a97bd9c3a53774bd3d08a92403b6e33c8c3db
parentbfb27b7caaab60ff40d3a651e6bcaa7c6c630db8 (diff)
chore(users/flokli/nixos-tvix-cache): switch to Mimir r/8984
VictoriaMetrics doesn't seem to "normalize" timeseries and label names,
which causes breakage in Grafana Dashboards querying label values.

Reported in VictoriaMetrics/VictoriaMetrics#7744.

Change-Id: I3397c4fd5911c9a3503d058c77c26e0db9300f36
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12867
Tested-by: BuildkiteCI
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: flokli <flokli@flokli.de>
-rw-r--r--users/flokli/nixos/nixos-tvix-cache/monitoring.nix36
1 files changed, 26 insertions, 10 deletions
diff --git a/users/flokli/nixos/nixos-tvix-cache/monitoring.nix b/users/flokli/nixos/nixos-tvix-cache/monitoring.nix
index d7c54c6a1434..5a74939a0acd 100644
--- a/users/flokli/nixos/nixos-tvix-cache/monitoring.nix
+++ b/users/flokli/nixos/nixos-tvix-cache/monitoring.nix
@@ -39,7 +39,7 @@ in
   services.alloy.enable = true;
 
   environment.etc."alloy/config.alloy".text = ''
-    // Accept OTLP. Forward metrics to victoriametrics, and traces to tempo.
+    // Accept OTLP. Forward metrics to mimir, and traces to tempo.
     otelcol.receiver.otlp "main" {
       grpc {
         endpoint = "[::1]:4317"
@@ -50,7 +50,7 @@ in
       }
 
       output {
-        metrics = [otelcol.exporter.otlphttp.victoriametrics.input]
+        metrics = [otelcol.exporter.otlphttp.mimir.input]
         traces = [otelcol.exporter.otlp.tempo.input]
       }
     }
@@ -65,10 +65,10 @@ in
       }
     }
 
-    // We push to VictoriaMetrics over otlp-http.
-    otelcol.exporter.otlphttp "victoriametrics" {
+    // We push to Mimir over otlp-http.
+    otelcol.exporter.otlphttp "mimir" {
       client {
-        endpoint = "http://localhost:8428/opentelemetry"
+        endpoint = "http://localhost:9009/otlp"
       }
     }
 
@@ -84,13 +84,29 @@ in
     // Convert Prometheus metrics to OTLP and export them.
     otelcol.receiver.prometheus "default" {
       output {
-        metrics = [otelcol.exporter.otlphttp.victoriametrics.input]
+        metrics = [otelcol.exporter.otlphttp.mimir.input]
       }
     }
   '';
 
-  services.victoriametrics.enable = true;
+  services.mimir.enable = true;
+  services.mimir.configuration = {
+    server.grpc_listen_address = "127.0.0.1";
+    server.grpc_listen_port = 9096; # default 9095 conflicts with tempo
+    server.http_listen_address = "127.0.0.1";
+    server.http_listen_port = 9009;
 
+    multitenancy_enabled = false;
+
+    # https://github.com/grafana/mimir/discussions/8773
+    compactor.sharding_ring.instance_addr = "127.0.0.1";
+    distributor.ring.instance_addr = "127.0.0.1";
+    store_gateway.sharding_ring.instance_addr = "127.0.0.1";
+    ingester.ring.instance_addr = "127.0.0.1";
+    ingester.ring.replication_factor = 1;
+
+    memberlist.advertise_addr = "127.0.0.1";
+  };
 
   services.grafana = {
     enable = true;
@@ -145,10 +161,10 @@ in
           };
         }
         {
-          name = "prometheus";
+          name = "mimir";
           type = "prometheus";
-          uid = "metrics";
-          url = "http://localhost:8428/";
+          uid = "mimir";
+          url = "http://localhost:9009/prometheus";
         }
       ];
     };