From 487f1418f17d83d9e732d5bce256de909d7d659f Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@private.storage>
Date: Thu, 8 Jul 2021 14:21:53 +0000
Subject: [PATCH] Make localhost the default for Grafana's TSDBs

Fewer lines almost always better.  Also, we don't want to spread
these out unless we have to.
---
 morph/lib/monitoring.nix                    | 5 -----
 nixos/modules/monitoring/server/grafana.nix | 4 ++--
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/morph/lib/monitoring.nix b/morph/lib/monitoring.nix
index f3358f8c..6df65a54 100644
--- a/morph/lib/monitoring.nix
+++ b/morph/lib/monitoring.nix
@@ -28,9 +28,4 @@ rec {
     # Loki 0.3.0 from Nixpkgs 19.09 is too old and does not work:
     # ../../nixos/modules/monitoring/server/loki.nix
   ];
-
-  services.private-storage.monitoring.grafana = {
-    prometheusUrl = "http://localhost:9090/";
-    lokiUrl = "http://localhost:3100/";
-  };
 }
diff --git a/nixos/modules/monitoring/server/grafana.nix b/nixos/modules/monitoring/server/grafana.nix
index 4360965b..d2214803 100644
--- a/nixos/modules/monitoring/server/grafana.nix
+++ b/nixos/modules/monitoring/server/grafana.nix
@@ -18,13 +18,13 @@ in {
     prometheusUrl = lib.mkOption
     { type = lib.types.str;
       example = lib.literalExample "http://prometheus:9090/";
-      default = "http://prometheus:9090/";
+      default = "http://localhost:9090/";
       description = "The URL of the Prometheus host to access";
     };
     lokiUrl = lib.mkOption
     { type = lib.types.str;
       example = lib.literalExample "http://loki:3100/";
-      default = "http://loki:3100/";
+      default = "http://localhost:3100/";
       description = "The URL of the Loki host to access";
     };
   };
-- 
GitLab