JMX exporter for Tomcat

4,659 views
Skip to first unread message

Jim Perry

unread,
Aug 22, 2018, 10:45:02 AM8/22/18
to Prometheus Users
Hi,

I'm trying to use the Prometheus JMX exporter to get Tomcat metrics. I grabbed the Tomcat config file from here:


I am able to get JVM metrics from the exporter and from the Prometheus server but not the Tomcat specific metrics. After doing some reading here I believe it is because of issues with the tomcat.yml file. I used the file verbatim from github .

Am I missing something in the tomcat.yml file? Was wondering if this is just a snippet and not the full contents of a .yml file. I'm new to Prometheus and was thinking I'm too naive to think I could just use the file as it.

In an effort to debug this I ran promtool to check the rules in my tomcat.yml file. It failed. Below I dump out the contents of the tomcat.yml file and show the output from promtool check rules command:


[vagrant@spacewalk prometheus-2.3.2.linux-amd64]$ cat ../tomcat.yml
---   
lowercaseOutputLabelNames: true
lowercaseOutputName: true
rules:
- 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|maxTime|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|pollerThreadCount|connectionCount):'
  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
[vagrant@spacewalk prometheus-2.3.2.linux-amd64]$ ./promtool check rules ../tomcat.yml
Checking ../tomcat.yml
  FAILED:
yaml: unmarshal errors:
  line 2: field lowercaseOutputLabelNames not found in type rulefmt.RuleGroups
  line 3: field lowercaseOutputName not found in type rulefmt.RuleGroups
  line 4: field rules not found in type rulefmt.RuleGroups

[vagrant@spacewalk prometheus-2.3.2.linux-amd64]$ 



Does anyone have any insight into the issues with the tomcat.yml file? I'll continue to debug this but was wondering if anyone else is already doing this successfully.

Thanks in advance,
Jim


frank....@interface-projects.de

unread,
Aug 22, 2018, 12:50:26 PM8/22/18
to Prometheus Users
The tomcat.yml is thought for the jmx exporter not for prometheus. so promtool (which only validates prometheus config files ) complains about the wrong/unknown elements. you have to run the jmx exporter with tomcat.yml and configure prometheus to fetch the metrics from jmx exporter.

Jim Perry

unread,
Aug 22, 2018, 1:38:26 PM8/22/18
to frank....@interface-projects.de, promethe...@googlegroups.com
Thank you for your reply.

I think I understand your point. I can't use the promtool to validate the tomcat.yml file. promtool will only validate the prometheus.yml file. Okay, so I won't worry about the errors from promtool.

But I still don't understand why I'm not getting the tomcat specific metrics. I'm only seeing jvm metrics from the JMX java agent. A little more information:

Here are the contents of my prometheus.yml file:

[vagrant@spacewalk prometheus-2.3.2.linux-amd64]$ cat prometheus.yml
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
scrape_configs:
  - job_name: 'tomcat'
    static_configs:
     - targets: ['localhost:9001'] 
[vagrant@spacewalk prometheus-2.3.2.linux-amd64]$ 

I post the contents of the tomcat.yml file here already.

Here is are tomcat processes showing JMX is enabled and listening on port 9000 and the JMX java agent is listening on port 9001:

root     23519  5189  0 13:06 pts/2    00:00:00 sudo /usr/lib/jvm/jre/bin/java -ea -Xms256m -Xmx256m -Djava.awt.headless=true -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Dorg.apache.tomcat.util.http.Parameters.MAX_COUNT=1024 -XX:MaxNewSize=256 -XX:-UseConcMarkSweepGC -Dnet.sf.ehcache.skipUpdateCheck=true -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -javaagent:/home/vagrant/jmx_prometheus_javaagent-0.3.1.jar=9001:/home//vagrant/tomcat.yml -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start
root     23520 23519 43 13:06 pts/2    00:00:47 /usr/lib/jvm/jre/bin/java -ea -Xms256m -Xmx256m -Djava.awt.headless=true -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Dorg.apache.tomcat.util.http.Parameters.MAX_COUNT=1024 -XX:MaxNewSize=256 -XX:-UseConcMarkSweepGC -Dnet.sf.ehcache.skipUpdateCheck=true -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -javaagent:/home/vagrant/jmx_prometheus_javaagent-0.3.1.jar=9001:/home//vagrant/tomcat.yml -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start
vagrant  23657  5189  0 13:08 pts/2    00:00:00 grep --color=auto tomcat

I can use jconsole to view the Tomcat MBeans and their metrics on port 9000. I can use curl to get metrics from the JMX java agent but only the JVM metrics are being collected and shown, not any of the Tomcat specific metrics. I've included the output from the curl command to the JXM java agent below. I can also use curl to get the JVM metrics from the prometheus server running on port 9090. But I don't understand why I am not seeing the tomcat specific metrics. For example, the tomcat.yml specifies to collect the following metrics:
  • requestCount
  • maxTime
  • processingTime
  • errorCount
  • currentThreadCount
  • currentThreadsBusy
  • keepAliveCount
  • pollerThreadCount
  • connectionCount
  • sessionCounter
  • rejectedSessions
  • expiredSessions
I believe the issue must have to do with the tomcat.yml file put I'm using the latest one from github. Is anyone else able to collect Tomcat metrics and if so can you see what I am doing wrong? Can you spot any issues in the tomcat.yml file? 

Thanks in advance for any help,
Jim

Here is the output from the JMX java agent listening on port 9001. As you can see there are only JMX metrics, no Tomcat specific metrics:

[vagrant@spacewalk ~]$ curl https://127.0.0.1:9001/metrics -k -v  --noproxy "*" 
* About to connect() to 127.0.0.1 port 9001 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 9001 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
^C
[vagrant@spacewalk ~]$ curl http://127.0.0.1:9001/metrics -k -v  --noproxy "*" 
* About to connect() to 127.0.0.1 port 9001 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 9001 (#0)
> GET /metrics HTTP/1.1
> User-Agent: curl/7.29.0
> Accept: */*
< HTTP/1.1 200 OK
< Date: Wed, 22 Aug 2018 17:32:48 GMT
< Content-type: text/plain; version=0.0.4; charset=utf-8
< Content-length: 6819
# HELP jmx_config_reload_success_total Number of times configuration have successfully been reloaded.
# TYPE jmx_config_reload_success_total counter
jmx_config_reload_success_total 0.0
# HELP jvm_gc_collection_seconds Time spent in a given JVM garbage collector in seconds.
# TYPE jvm_gc_collection_seconds summary
jvm_gc_collection_seconds_count{gc="PS Scavenge",} 84365.0
jvm_gc_collection_seconds_sum{gc="PS Scavenge",} 132.696
jvm_gc_collection_seconds_count{gc="PS MarkSweep",} 7.0
jvm_gc_collection_seconds_sum{gc="PS MarkSweep",} 0.778
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 317.84
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.534957597234E9
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 109.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 4096.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 2.980450304E9
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 4.8275456E8
# HELP jvm_threads_current Current thread count of a JVM
# TYPE jvm_threads_current gauge
jvm_threads_current 93.0
# HELP jvm_threads_daemon Daemon thread count of a JVM
# TYPE jvm_threads_daemon gauge
jvm_threads_daemon 56.0
# HELP jvm_threads_peak Peak thread count of a JVM
# TYPE jvm_threads_peak gauge
jvm_threads_peak 95.0
# HELP jvm_threads_started_total Started thread count of a JVM
# TYPE jvm_threads_started_total counter
jvm_threads_started_total 98.0
# HELP jvm_threads_deadlocked Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers
# TYPE jvm_threads_deadlocked gauge
jvm_threads_deadlocked 0.0
# HELP jvm_threads_deadlocked_monitor Cycles of JVM-threads that are in deadlock waiting to acquire object monitors
# TYPE jvm_threads_deadlocked_monitor gauge
jvm_threads_deadlocked_monitor 0.0
# HELP jmx_config_reload_failure_total Number of times configuration have failed to be reloaded.
# TYPE jmx_config_reload_failure_total counter
jmx_config_reload_failure_total 0.0
# HELP jvm_buffer_pool_used_bytes Used bytes of a given JVM buffer pool.
# TYPE jvm_buffer_pool_used_bytes gauge
jvm_buffer_pool_used_bytes{pool="direct",} 40960.0
jvm_buffer_pool_used_bytes{pool="mapped",} 0.0
# HELP jvm_buffer_pool_capacity_bytes Bytes capacity of a given JVM buffer pool.
# TYPE jvm_buffer_pool_capacity_bytes gauge
jvm_buffer_pool_capacity_bytes{pool="direct",} 40960.0
jvm_buffer_pool_capacity_bytes{pool="mapped",} 0.0
# HELP jvm_buffer_pool_used_buffers Used buffers of a given JVM buffer pool.
# TYPE jvm_buffer_pool_used_buffers gauge
jvm_buffer_pool_used_buffers{pool="direct",} 5.0
jvm_buffer_pool_used_buffers{pool="mapped",} 0.0
# HELP jvm_info JVM version info
# TYPE jvm_info gauge
jvm_info{version="1.8.0_181-b13",vendor="Oracle Corporation",runtime="OpenJDK Runtime Environment",} 1.0
# HELP jvm_classes_loaded The number of classes that are currently loaded in the JVM
# TYPE jvm_classes_loaded gauge
jvm_classes_loaded 7379.0
# HELP jvm_classes_loaded_total The total number of classes that have been loaded since the JVM has started execution
# TYPE jvm_classes_loaded_total counter
jvm_classes_loaded_total 7421.0
# HELP jvm_classes_unloaded_total The total number of classes that have been unloaded since the JVM has started execution
# TYPE jvm_classes_unloaded_total counter
jvm_classes_unloaded_total 42.0
# HELP jmx_scrape_duration_seconds Time this JMX scrape took, in seconds.
# TYPE jmx_scrape_duration_seconds gauge
jmx_scrape_duration_seconds 1.862346801
# HELP jmx_scrape_error Non-zero if this scrape failed.
# TYPE jmx_scrape_error gauge
jmx_scrape_error 0.0
# HELP jvm_memory_bytes_used Used bytes of a given JVM memory area.
# TYPE jvm_memory_bytes_used gauge
jvm_memory_bytes_used{area="heap",} 1.58817312E8
jvm_memory_bytes_used{area="nonheap",} 8.480532E7
# HELP jvm_memory_bytes_committed Committed (bytes) of a given JVM memory area.
# TYPE jvm_memory_bytes_committed gauge
jvm_memory_bytes_committed{area="heap",} 2.67911168E8
jvm_memory_bytes_committed{area="nonheap",} 8.8170496E7
# HELP jvm_memory_bytes_max Max (bytes) of a given JVM memory area.
# TYPE jvm_memory_bytes_max gauge
jvm_memory_bytes_max{area="heap",} 2.67911168E8
jvm_memory_bytes_max{area="nonheap",} -1.0
# HELP jvm_memory_bytes_init Initial bytes of a given JVM memory area.
# TYPE jvm_memory_bytes_init gauge
jvm_memory_bytes_init{area="heap",} 2.68435456E8
jvm_memory_bytes_init{area="nonheap",} 2555904.0
# HELP jvm_memory_pool_bytes_used Used bytes of a given JVM memory pool.
# TYPE jvm_memory_pool_bytes_used gauge
jvm_memory_pool_bytes_used{pool="Code Cache",} 1.8313792E7
jvm_memory_pool_bytes_used{pool="Metaspace",} 6.1262624E7
jvm_memory_pool_bytes_used{pool="Compressed Class Space",} 5228904.0
jvm_memory_pool_bytes_used{pool="PS Eden Space",} 437800.0
jvm_memory_pool_bytes_used{pool="PS Survivor Space",} 65536.0
jvm_memory_pool_bytes_used{pool="PS Old Gen",} 1.58324328E8
# HELP jvm_memory_pool_bytes_committed Committed bytes of a given JVM memory pool.
# TYPE jvm_memory_pool_bytes_committed gauge
jvm_memory_pool_bytes_committed{pool="Code Cache",} 1.8481152E7
jvm_memory_pool_bytes_committed{pool="Metaspace",} 6.3922176E7
jvm_memory_pool_bytes_committed{pool="Compressed Class Space",} 5767168.0
jvm_memory_pool_bytes_committed{pool="PS Eden Space",} 524288.0
jvm_memory_pool_bytes_committed{pool="PS Survivor Space",} 524288.0
jvm_memory_pool_bytes_committed{pool="PS Old Gen",} 2.66862592E8
# HELP jvm_memory_pool_bytes_max Max bytes of a given JVM memory pool.
# TYPE jvm_memory_pool_bytes_max gauge
jvm_memory_pool_bytes_max{pool="Code Cache",} 2.5165824E8
jvm_memory_pool_bytes_max{pool="Metaspace",} -1.0
jvm_memory_pool_bytes_max{pool="Compressed Class Space",} 1.073741824E9
jvm_memory_pool_bytes_max{pool="PS Eden Space",} 524288.0
jvm_memory_pool_bytes_max{pool="PS Survivor Space",} 524288.0
jvm_memory_pool_bytes_max{pool="PS Old Gen",} 2.66862592E8
# HELP jvm_memory_pool_bytes_init Initial bytes of a given JVM memory pool.
# TYPE jvm_memory_pool_bytes_init gauge
jvm_memory_pool_bytes_init{pool="Code Cache",} 2555904.0
jvm_memory_pool_bytes_init{pool="Metaspace",} 0.0
jvm_memory_pool_bytes_init{pool="Compressed Class Space",} 0.0
jvm_memory_pool_bytes_init{pool="PS Eden Space",} 524288.0
jvm_memory_pool_bytes_init{pool="PS Survivor Space",} 524288.0
jvm_memory_pool_bytes_init{pool="PS Old Gen",} 2.66862592E8
* Connection #0 to host 127.0.0.1 left intact
[vagrant@spacewalk ~]$ 




--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/188b5949-69f8-45e2-aa9e-577827f5c17f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Perry

unread,
Aug 22, 2018, 6:09:53 PM8/22/18
to Prometheus Users
I turned on fine logging to see if I could see any errors during scraping by adding these lines these to my logging.properties:

io.prometheus.jmx.level=ALL
io.prometheus.jmx.shaded.io.prometheus.jmx.level=ALL

When I issue the following curl command:

curl http://127.0.0.1:9001 -k -v  --noproxy "*"

I actually see the Tomcat specific attributes being scrapped in the logs. For example,  here are the currentThreadCount metrics output in the logs:

FINE: scrape: 'Catalina:type=ThreadPool,name="http-bio-127.0.0.1-8080"'_'currentThreadCount': process
FINE: scrape: 'Catalina{type=ThreadPool, name="http-bio-127.0.0.1-8080"}currentThreadCount': 10
FINE: scrape: 'Catalina:type=ThreadPool,name="ajp-bio-127.0.0.1-8009"'_'currentThreadCount': process
FINE: scrape: 'Catalina{type=ThreadPool, name="ajp-bio-127.0.0.1-8009"}currentThreadCount': 10
FINE: scrape: 'Catalina:type=ThreadPool,name="ajp-bio-0:0:0:0:0:0:0:1-8009"'_'currentThreadCount': process
FINE: scrape: 'Catalina{type=ThreadPool, name="ajp-bio-0:0:0:0:0:0:0:1-8009"}currentThreadCount': 10

yet the http response returned by the curl command doesn't contain these values. So the metrics are scraped from Tomcat but dropped/not returned because the pattern doesn't match my rule definition? I am definitely trying to get this metric in my tomcat.yml file:
Would really appreciate it if someone could shed some light on why I'm not seeing the Tomcat metrics in the curl response.

Thanks.
Jim

Frank Taffelt

unread,
Aug 23, 2018, 1:39:32 AM8/23/18
to Prometheus Users

This is my config file which works for me, maybe you can spot some differences:

---

lowercaseOutputLabelNames: true

lowercaseOutputName: true

whitelistObjectNames: ["Tomcat:*","Catalina:*"]

rules:

- pattern: '.*<type=GlobalRequestProcessor, name=\"(\w+-\w+)-(\d+)\"><>(\w+):'

  name: tomcat_$3_total

  labels:

    port: "$2"

    protocol: "$1"

  help: Tomcat global $3

  type: COUNTER

- pattern: '.*<type=ThreadPool, name="(\w+-\w+)-(\d+)"><>(currentThreadCount|currentThreadsBusy|keepAliveCount|pollerThreadCount|connectionCount):'

  name: tomcat_threadpool_$3

  labels:

    port: "$2"

    protocol: "$1"

  help: Tomcat threadpool $3

  type: COUNTER

- pattern: '.*<type=Manager, host=([-a-zA-Z0-9+&@#/%?=~_|!:.,;]*[-a-zA-Z0-9+&@#/%=~_|]), context=([-a-zA-Z0-9+/$%~_-|!.]*)><>(processingTime|sessionCounter|rejectedSessions|expiredSessions|activeSessions):'

  name: tomcat_session_$3_total

  labels:

    context: "$2"

  help: Tomcat session $3 total

  type: GAUGE

 

hth,

Frank

 

--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/lLbvbZx4coY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-use...@googlegroups.com.


To post to this group, send email to promethe...@googlegroups.com.

Frank Taffelt

unread,
Aug 29, 2018, 2:48:35 AM8/29/18
to Jim Perry, Prometheus Users

Hmm you are right using the latest javaagent (0.3.1) this request takes avg. 40 seconds to process on my testsystem.

 

But I don’t use the jmx exporter with the javaagent way. I’m using the class JmxCollector from the JMX Exporter (v 0.1.0) in a own servlet this way:

 

URL url;

// path is tomcat.yml

if (!path.startsWith("file:/")) {

       url = getClass().getClassLoader().getResource(path);

} else {

       url = new URL(path);

}

new JmxCollector(new FileReader(new File(url.getFile()))).register();

 

this setup works for JAVA 8/10 and Tomcat (8/9).

 

Maybe there is an regression introduced in latest JMX Exporter?

 

hth,

Frank

 

From: Jim Perry <jimpe...@gmail.com>
Sent: Tuesday, August 28, 2018 5:25 PM
To: Frank Taffelt <Frank....@interface-projects.de>
Subject: Re: [prometheus-users] Re: JMX exporter for Tomcat

 

Thank you Frank. I tried your tomcat.yml file and got the same results. Enabling the following in the logging properties:

 

io.prometheus.jmx.level=ALL

io.prometheus.jmx.shaded.io.prometheus.jmx.level=ALL

 

I can see the Catalina metrics being scraped from the logs. But when I directly hit the url that that the agent is listening on from both curl and a browser it just hangs. I'm logged into a Vagrant VM where the JMX agent and Tomcat are running. The JMX agent is configured to be listening on port 9001. When I issue the following curl command it hangs using the tomcat.yml file you attached:

 

curl "http://127.0.0.1:9001" -k -v  --noproxy "*"

 

It is my understanding that this should return the JMX metrics based on the scrap rules in the tomcat.yml. But like I said the curl command just hangs. It does generate a ton of log messages in the catalina log file as it attempts to scape but nothing is returned. As a test I changed the tomcat.yml file so that everything is collected with these contents in tomcat.yml:

 

---

lowercaseOutputLabelNames: true

lowercaseOutputName: true

whitelistObjectNames: ["Tomcat:*","Catalina:*"]

rules:

- pattern: '.*'

 

Oddly enough this does collect all the Tomcat MBean metrics and returned them from the curl command

 

I'm stump as to why I can't seem to get a reasonable set of scape rules to work with Tomcat. I'm running prometheus-2.3.2.linux-amd64 with jmx_prometheus_javaagent-0.3.1.jar. What versions are you running? Can you issue a curl command to get the metrics directly from your running JMX agent without it hanging?

 

For the sake of completeness here are the contents of my prometheus.yml file:

 

global:

  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.

  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.

scrape_configs:

  - job_name: 'tomcat'

    static_configs:

     - targets: ['localhost:9001']

  - job_name: 'apache'

    scrape_interval: '15s'

    static_configs:

    - targets: ['localhost:9117']

 

Thanks.

Jim

 

 

 

 

 

 

 

 

On Tue, Aug 28, 2018 at 1:40 AM Frank Taffelt <Frank....@interface-projects.de> wrote:

Hi Jim,

 

see my attachment.

 

Frank

 

From: Jim Perry <jimpe...@gmail.com>
Sent: Monday, August 27, 2018 5:57 PM
To: Frank Taffelt <Frank....@interface-projects.de>
Subject: Re: [prometheus-users] Re: JMX exporter for Tomcat

 

Thanks Frank. Can you attach your config file rather than dumping the contents? When I cut and paste the config you listed here into a config file my curl and browser just hangs when I try to get metrics from the JMX agent.

 

Thanks

Jim

 

 

--

You received this message because you are subscribed to the Google Groups "Prometheus Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.


To post to this group, send email to promethe...@googlegroups.com.

Anna Dowling

unread,
Jul 5, 2019, 6:45:43 AM7/5/19
to Prometheus Users
Hi All,

Was this issue ever resolved? I am having the same problem when using the example from github: https://github.com/prometheus/jmx_exporter/blob/master/example_configs/tomcat.yml

I also tried editing my config file to match the one posted by Frank but this did not work either.
Reply all
Reply to author
Forward
0 new messages