Skip to content

Commit

Permalink
serve jmx Prometheus metrics on 12345 port
Browse files Browse the repository at this point in the history
  • Loading branch information
bondiano committed Sep 20, 2023
1 parent 7ee66b5 commit 3877895
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN lein uberjar
FROM eclipse-temurin:20-jdk

RUN mkdir -p /opt/jmx_exporter
RUN wget -O /opt/jmx_exporter/jmx_prometheus_httpserver-0.19.0.jar https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_httpserver/0.19.0/jmx_prometheus_httpserver-0.19.0.jar
RUN wget -O /opt/jmx_exporter/jmx_prometheus_javaagent-0.16.1.jar https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar
COPY jmx-config.yaml /opt/jmx_exporter/config.yaml

Expand All @@ -24,5 +25,6 @@ COPY config.edn /service/config.edn
COPY --from=builder /build/target/app.jar /service/app.jar

EXPOSE 4201
EXPOSE 12345

ENTRYPOINT ["./service/entrypoint.sh"]
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ JMX_OPTS="-javaagent:/opt/jmx_exporter/jmx_prometheus_javaagent-0.16.1.jar=8080:
# JVM options
JAVA_OPTS="-XX:InitialRAMPercentage=30 -XX:MaxRAMPercentage=85 -XX:+UseContainerSupport -XshowSettings:system "

java $JAVA_OPTS -jar /opt/jmx_exporter/jmx_prometheus_httpserver-0.19.0.jar 12345 /opt/jmx_exporter/config.yaml &
java $JMX_OPTS \
$JAVA_OPTS \
-jar $JAR_PATH "$@"
1 change: 1 addition & 0 deletions jmx-config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
hostPort: 0.0.0.0:12345
rules:
- pattern: ".*"

0 comments on commit 3877895

Please sign in to comment.