From a197e7dfac2ef8da88f1a182712c0fd240a60d88 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 21 May 2021 08:34:06 +0200 Subject: [PATCH] Pre-configure prometheus data source in Grafana This mysteriously fixes the data source test "not found" error. --- conf-grafana/datasource.yaml | 8 ++++++++ launch.sh | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 conf-grafana/datasource.yaml diff --git a/conf-grafana/datasource.yaml b/conf-grafana/datasource.yaml new file mode 100644 index 0000000..46eb97e --- /dev/null +++ b/conf-grafana/datasource.yaml @@ -0,0 +1,8 @@ +apiVersion: 1 +datasources: +- name: Prometheus + type: prometheus + url: http://localhost:9090 + isDefault: true + access: proxy + editable: true diff --git a/launch.sh b/launch.sh index 8f0dc79..14eaeec 100755 --- a/launch.sh +++ b/launch.sh @@ -1,4 +1,9 @@ #!/bin/sh set -eux -podman run -d --pod new:learn-metrics --name metrics-grafana -p 3000:3000 -p 3001:9090 -e GF_SECURITY_ADMIN_PASSWORD=foobar quay.io/bitnami/grafana +podman run -d --pod new:learn-metrics --name metrics-grafana \ + -p 3000:3000 -p 3001:9090 \ + -e GF_SECURITY_ADMIN_PASSWORD=foobar \ + -v ./conf-grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml:ro \ + quay.io/bitnami/grafana + podman run -d --pod learn-metrics --name metrics-prometheus docker.io/prom/prometheus -- 2.39.2