From: Martin Pitt Date: Fri, 21 May 2021 06:34:06 +0000 (+0200) Subject: Pre-configure prometheus data source in Grafana X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=a197e7dfac2ef8da88f1a182712c0fd240a60d88;p=learn-metrics.git Pre-configure prometheus data source in Grafana This mysteriously fixes the data source test "not found" error. --- 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