From b293ebed1bb233a61553959350af8af150d72ce5 Mon Sep 17 00:00:00 2001 From: Isman Firmansyah Date: Thu, 19 Dec 2024 20:46:20 +0700 Subject: [PATCH] fix(cloud-native): applications are failing to start when prometheus metrics are enabled (#10459) * fix(cloud-native): applications are failing to start when prometheus metrics are enabled Signed-off-by: iromli * fix(docker-jans-all-in-one): applications are failing to start when prometheus metrics are enabled Signed-off-by: moabu <47318409+moabu@users.noreply.github.com> --------- Signed-off-by: iromli Signed-off-by: moabu <47318409+moabu@users.noreply.github.com> Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com> --- docker-jans-all-in-one/app/bin/entrypoint.sh | 4 ++-- docker-jans-auth-server/scripts/entrypoint.sh | 4 ++-- docker-jans-casa/Dockerfile | 2 +- docker-jans-casa/scripts/entrypoint.sh | 4 ++-- docker-jans-config-api/scripts/entrypoint.sh | 4 ++-- docker-jans-fido2/scripts/entrypoint.sh | 4 ++-- docker-jans-keycloak-link/scripts/entrypoint.sh | 4 ++-- docker-jans-link/scripts/entrypoint.sh | 4 ++-- docker-jans-scim/scripts/entrypoint.sh | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docker-jans-all-in-one/app/bin/entrypoint.sh b/docker-jans-all-in-one/app/bin/entrypoint.sh index b4ce479d3aa..c339f5c3daa 100644 --- a/docker-jans-all-in-one/app/bin/entrypoint.sh +++ b/docker-jans-all-in-one/app/bin/entrypoint.sh @@ -4,10 +4,10 @@ set -e get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi } diff --git a/docker-jans-auth-server/scripts/entrypoint.sh b/docker-jans-auth-server/scripts/entrypoint.sh index c34f833ddab..fa2cb3839e9 100644 --- a/docker-jans-auth-server/scripts/entrypoint.sh +++ b/docker-jans-auth-server/scripts/entrypoint.sh @@ -28,10 +28,10 @@ get_prometheus_opt() { get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi } diff --git a/docker-jans-casa/Dockerfile b/docker-jans-casa/Dockerfile index 118f02f14a4..84b976afbaf 100644 --- a/docker-jans-casa/Dockerfile +++ b/docker-jans-casa/Dockerfile @@ -6,7 +6,7 @@ FROM bellsoft/liberica-openjre-alpine:17.0.12@sha256:29cb2ee552c7c7a924b6a1b5980 RUN apk update \ && apk upgrade --available \ - && apk add --no-cache python3 openssl tini py3-cryptography py3-psycopg2 py3-grpcio \ + && apk add --no-cache python3 openssl tini py3-cryptography py3-psycopg2 py3-grpcio curl \ && apk add --no-cache --virtual .build-deps git wget zip # ===== diff --git a/docker-jans-casa/scripts/entrypoint.sh b/docker-jans-casa/scripts/entrypoint.sh index 34add7a31da..6c5104e0925 100644 --- a/docker-jans-casa/scripts/entrypoint.sh +++ b/docker-jans-casa/scripts/entrypoint.sh @@ -18,10 +18,10 @@ get_prometheus_opt() { get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi } diff --git a/docker-jans-config-api/scripts/entrypoint.sh b/docker-jans-config-api/scripts/entrypoint.sh index e364f1eeece..cb8480fc80d 100644 --- a/docker-jans-config-api/scripts/entrypoint.sh +++ b/docker-jans-config-api/scripts/entrypoint.sh @@ -27,10 +27,10 @@ get_prometheus_opt() { get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi } diff --git a/docker-jans-fido2/scripts/entrypoint.sh b/docker-jans-fido2/scripts/entrypoint.sh index 8dfbc216e90..8c8a4f32c57 100644 --- a/docker-jans-fido2/scripts/entrypoint.sh +++ b/docker-jans-fido2/scripts/entrypoint.sh @@ -18,10 +18,10 @@ get_prometheus_opt() { get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi } diff --git a/docker-jans-keycloak-link/scripts/entrypoint.sh b/docker-jans-keycloak-link/scripts/entrypoint.sh index cd0320168d5..cd1eff2165e 100644 --- a/docker-jans-keycloak-link/scripts/entrypoint.sh +++ b/docker-jans-keycloak-link/scripts/entrypoint.sh @@ -18,10 +18,10 @@ get_prometheus_opt() { get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi } diff --git a/docker-jans-link/scripts/entrypoint.sh b/docker-jans-link/scripts/entrypoint.sh index 465b2c8c344..fe89f8a56df 100644 --- a/docker-jans-link/scripts/entrypoint.sh +++ b/docker-jans-link/scripts/entrypoint.sh @@ -18,10 +18,10 @@ get_prometheus_opt() { get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi } diff --git a/docker-jans-scim/scripts/entrypoint.sh b/docker-jans-scim/scripts/entrypoint.sh index d4a66edb3e0..e54d5a1dd4c 100644 --- a/docker-jans-scim/scripts/entrypoint.sh +++ b/docker-jans-scim/scripts/entrypoint.sh @@ -18,10 +18,10 @@ get_prometheus_opt() { get_prometheus_lib() { if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_agent_version="0.17.2" + agent_version=${PROMETHEUS_AGENT_VERSION:-1.0.1} if [ ! -f /opt/prometheus/jmx_prometheus_javaagent.jar ]; then - wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${prom_agent_version}/jmx_prometheus_javaagent-${prom_agent_version}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar + curl -sS "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${agent_version}/jmx_prometheus_javaagent-${agent_version}.jar" -o /opt/prometheus/jmx_prometheus_javaagent.jar fi fi }