Prometheus failed to scrape metrics from tomcat container

88 views
Skip to first unread message

sarbajit das

unread,
Nov 19, 2021, 12:47:34 PM11/19/21
to Prometheus Developers
Hi All,
I am trying to deploy a small application in a tomcat docker container and trying to monitor the container using Prometheus with the help of node exporter. But I am unable scrape metrics even though metrics is actually being pulled as i can see the output from browser or by using curl or wget command.

Prometheus error : context deadline exceeded

Below is my Dockerfile :

FROM jatayu99/my-tomcat:latest
ADD prometheus-jmx-config.yml /prometheus-jmx-config.yml
ADD jmx_prometheus_javaagent-0.13.0.jar /jmx_prometheus_javaagent-0.13.0.jar
COPY ConferenceRoomCapstoneB35.war /usr/local/tomcat/webapps
ENV JAVA_OPTS="$JAVA_OPTS -javaagent:/jmx_prometheus_javaagent-0.13.0.jar=9830:/prometheus-jmx-config.yml"
EXPOSE 9830 8080

sarbajit@UBUNTU:~/expr/proj-ansi-roles$ cat roles/03-build-image/files/prometheus-jmx-config.yml
ssl: false
lowercaseOutputName: false
lowercaseOutputLabelNames: false

But if I try to use port 8080 for jmx_prometheus_javaagent-0.13.0.jar then prometheus is able to pull the metrics but my application is not running in that scenario.

Can anyone please help regarding this problem ??

Thanks & Regards,
Sarbajit Das
Reply all
Reply to author
Forward
0 new messages