summaryrefslogtreecommitdiff
path: root/hosts/chaski
diff options
context:
space:
mode:
authorstuebinm2021-03-25 01:30:19 +0100
committerstuebinm2021-03-25 01:30:19 +0100
commitdb0bf3410464e696c538be4c091eeaaa72979db1 (patch)
tree48ced0bb1c752184f1825a0ac052f3fdc600755f /hosts/chaski
parenta18a3bed5047a7c589bba9c7569a6ae953b3803d (diff)
chaski: add scrape.stuebinm.eu
Diffstat (limited to '')
-rw-r--r--hosts/chaski/configuration.nix1
-rw-r--r--hosts/chaski/services/grafana.nix39
2 files changed, 40 insertions, 0 deletions
diff --git a/hosts/chaski/configuration.nix b/hosts/chaski/configuration.nix
index 14b297b..671bc13 100644
--- a/hosts/chaski/configuration.nix
+++ b/hosts/chaski/configuration.nix
@@ -10,6 +10,7 @@
./hardware-configuration.nix
./services/coturn.nix
./services/cgit.nix
+ ./services/grafana.nix
];
hexchen.deploy = {
diff --git a/hosts/chaski/services/grafana.nix b/hosts/chaski/services/grafana.nix
new file mode 100644
index 0000000..d520b20
--- /dev/null
+++ b/hosts/chaski/services/grafana.nix
@@ -0,0 +1,39 @@
+{ config, pkgs, ... }:
+
+{
+ services.prometheus = {
+ enable = true;
+ port = 9001;
+ scrapeConfigs = [ {
+ job_name = "lmucast-docker";
+ static_configs = [ {
+ targets = [ "cast.itunes.uni-muenchen.de:9101" ];
+ } ];
+ } ];
+ };
+
+ services.grafana = {
+ enable = true;
+ port = 5000;
+ addr = "[::]";
+ rootUrl = "https://scrape.stuebinm.eu/";
+ auth.anonymous.enable = true;
+ provision = {
+ enable = true;
+ datasources = [ {
+ name = "lmucast";
+ type = "prometheus";
+ url = "http://localhost:9001";
+ } ];
+ };
+ };
+
+ services.nginx.virtualHosts."scrape.stuebinm.eu" = {
+ locations."/" = {
+ proxyPass = "http://localhost:5000";
+ proxyWebsockets = true;
+ };
+ enableACME = true;
+ forceSSL = true;
+ };
+}