ObserveNow
...
Integrations
Infrastructure
Apache Tomcat
opsverse observenow can pull logs and metrics from apache tomcat using the jmx exporter that can be configured using the opsverse agent please follow the steps below to configure the agent to monitor your tomcat installation prerequisite opsverse observenow agent installed on the vm running tomcat following the steps mentioned here assuming you have the observenow agent up and running on the vm, you can follow the nest steps to configure tomcat observability metrics install the jmx exporter \# for amd64 curl https //raw\ githubusercontent com/opsverseio/installers/main/prometheus exporters/install exporter amd64 sh | sudo bash s e jmx \# for arm64 curl https //raw\ githubusercontent com/opsverseio/installers/main/prometheus exporters/install exporter arm64 sh | sudo bash s e jmx configure jmx exporter for tomcat open /etc/opsverse/exporters/jmx/config yaml and add the following config into it lowercaseoutputlabelnames true lowercaseoutputname true whitelistobjectnames \["java lang\ type=operatingsystem", "catalina "] blacklistobjectnames \[] rules \ pattern 'catalina\<type=server><>serverinfo ( +)' name tomcat serverinfo value 1 labels serverinfo "$1" type counter \ pattern 'catalina\<type=globalrequestprocessor, name=\\"(\w+ \w+) (\d+)\\"><>(\w+) ' name tomcat $3 total labels port "$2" protocol "$1" help tomcat global $3 type counter \ pattern 'catalina\<j2eetype=servlet, webmodule=//(\[ a za z0 9+&@#/%?= |! ,;] \[ a za z0 9+&@#/%= |]), name=(\[ a za z0 9+/$% |! ] ), j2eeapplication=none, j2eeserver=none><>(requestcount|processingtime|errorcount) ' name tomcat servlet $3 total labels module "$1" servlet "$2" help tomcat servlet $3 total type counter \ pattern 'catalina\<type=threadpool, name="(\w+ \w+) (\d+)"><>(currentthreadcount|currentthreadsbusy|keepalivecount|connectioncount|acceptcount|acceptorthreadcount|pollerthreadcount|maxthreads|minsparethreads) ' name tomcat threadpool $3 labels port "$2" protocol "$1" help tomcat threadpool $3 type gauge \ pattern 'catalina\<type=manager, host=(\[ a za z0 9+&@#/%?= |! ,;] \[ a za z0 9+&@#/%= |]), context=(\[ a za z0 9+/$% |! ] )><>(processingtime|sessioncounter|rejectedsessions|expiredsessions) ' name tomcat session $3 total labels context "$2" host "$1" help tomcat session $3 total type counter configure tomcat to use jmx exporter in the same directory where catalina sh is, create a file named setenv sh ( usually /opt/tomcat/bin/ ) and add the following into the directory \#! /bin/sh export catalina opts="$catalina opts javaagent /usr/local/bin/jmx prometheus javaagent 1 1 0 jar=9404 /etc/opsverse/exporters/jmx/config yaml" ensure the file is executable using the command chmod +x setenv sh restart tomcat and in a few seconds you should start seeing tomcat metrics in the metrics explorer in your observenow grafana logs configure observe agent to pull apache tomcat logs into observenow, you only need to add a new block to the agent config open up /etc/opsverse/agent config yaml and under logs > configs > scrape configs add the following block \ job name tomcat static configs \ labels job tomcat host \<hostname> # add unique hostname path /opt/tomcat/logs/ # this path may be different depending on how tomcat was installed restart observe agent restart observe agent with sudo systemctl restart opsverse agent and you should see logs in your observenow grafana under the logs datasource with the label job = tomcat