--
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.
io.prometheus.jmx.level=ALL io.prometheus.jmx.shaded.io.prometheus.jmx.level=ALL
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/64d34659-5cf6-466a-8949-7f197ec2350e%40googlegroups.com.
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:
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7A92B6F3884160489E224CEA5B09FC5CCAEB65F1%40IFB-MX.ifbus.de.