From 391abe42adf3bf065d9543ada068b696b00efdcd Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Fri, 24 Feb 2023 00:49:12 -0800 Subject: deploy: add krakend monitoring using influxdb and grafana --- contrib/influx/initdb.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 contrib/influx/initdb.sh (limited to 'contrib/influx') diff --git a/contrib/influx/initdb.sh b/contrib/influx/initdb.sh new file mode 100755 index 0000000..b1d07af --- /dev/null +++ b/contrib/influx/initdb.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# The following script creates the authentication for Grafana +# and is meant to be added to InfluxDB docker-compose.yml file. +# image: influxdb +# volumes: +# - "./config/influx:/docker-entrypoint-initdb.d" +set -e + +# Retrieve the ID from the bucket created during setup +BUCKET_ID=$(influx bucket list | grep "$DOCKER_INFLUXDB_INIT_BUCKET" | awk '{print $1}') + +influx v1 auth create \ + --username ${DOCKER_INFLUXDB_INIT_USERNAME} \ + --password ${DOCKER_INFLUXDB_INIT_PASSWORD} \ + --write-bucket ${BUCKET_ID} \ + --org ${DOCKER_INFLUXDB_INIT_ORG} -- cgit v1.2.3