create and set token metrics prometheus for minio

This commit is contained in:
Gilles Mouchet 2025-06-17 16:03:34 +02:00
parent c065174d68
commit 9d96f8d8a9
2 changed files with 22 additions and 0 deletions

View File

@ -177,6 +177,7 @@ docker exec -it <COMPOSE_PROJECT_NAME>-proxy-1 /bin/bash -c "curl -H \"Accept: a
- script manage.sh - script manage.sh
#### Fixed #### Fixed
- certificates names - certificates names
### [1.1.0] - 2025-06-09 ### [1.1.0] - 2025-06-09
#### Added #### Added
- prometheus container - prometheus container

View File

@ -383,6 +383,27 @@ EOF
else else
echo -e "${VERT}ALREADY EXISTING${NORMAL}" echo -e "${VERT}ALREADY EXISTING${NORMAL}"
fi fi
# ----
echo -n "Set token minio metrics: "
token=$(docker exec vdg-loki-minio-cli-1 mc admin prometheus generate myminio|grep bearer_token| sed 's/^[ \t]*//')
#token=$(docker exec -it vdg-loki-minio-cli-1 /bin/sh -c "mc admin prometheus generate myminio" | grep bearer_token)
rc1=$?
if [ $rc1 -eq 0 ]; then
echo -e "${VERT}SUCCESSFULLY CREATED${NORMAL}"
else
echo -e "${ROUGE}ERROR ($rc1)${NORMAL}"
exit $rc1
fi
# ----
echo -n "Set token in prometheus config: "
sudo sed -i "s|bearer_token:\(.*\)|$token|" ${PROM_CONF_DIR}/prometheus.yml
rc1=$?
if [ $rc1 -eq 0 ]; then
echo -e "${VERT}SUCCESS${NORMAL}"
else
echo -e "${ROUGE}ERROR ($rc1)${NORMAL}"
exit $rc1
fi
# ---- # ----
echo -e "\n---- Create container ----" echo -e "\n---- Create container ----"
create_container create_container