So, downloaded the jmx_prometheus_httpserver-0.12.0-jar-with-dependencies.jar and ran the following command:
nohup java -jar jmx_prometheus_httpserver-0.12.0-jar-with-dependencies.jar 9104 jmx_exporter.yaml &
Tried various options with hostPort and jmxURL options in the yaml file. None of them could fetch the weblogic metrics.
Hence looking for sample weblogic.yml to get the weblogic metrics.
What should be used in hostHost? Is it weblogic server host and port or jmx server and port ?
Content of jmx_exporter.yaml used and various options tried are as follows
username: weblogic
password: **********
ssl: false
attrNameSnakeCase: true
lowercaseOutputName: true
lowercaseOutputLabelNames: true
whitelistObjectNames:
- "com.bea:Name=*,Type=ServerRuntime"
- "com.bea:ServerRuntime=*,Type=ApplicationRuntime,*"
- "com.bea:ServerRuntime=*,Type=JDBCDataSourceRuntime,*"
- "com.bea:ServerRuntime=*,Type=JMSDestinationRuntime,*"
- "com.bea:ServerRuntime=*,Type=JDBCStoreRuntime,*"
rules:
# ex: com.bea<ServerRuntime=AdminServer, Name=default, ApplicationRuntime=moduleJMS, Type=WorkManagerRuntime><>CompletedRequests
- pattern: "^com.bea<ServerRuntime=(.+), Name=(.+), (.+)Runtime=(.*), Type=(.+)Runtime><>(.+):"
name: weblogic_$3_$5_$6
attrNameSnakeCase: true
labels:
runtime: $1
name: $2
application: $4
# ex: com.bea<ServerRuntime=AdminServer, Name=dsName, Type=JDBCDataSourceRuntime><>Metric
- pattern: "^com.bea<ServerRuntime=(.+), Name=(.+), Type=(.+)Runtime><>(.+):"
name: weblogic_$3_$4
attrNameSnakeCase: true
labels:
runtime: $1
name: $2
# ex: com.bea<ServerRuntime=AdminServer, Name=bea_wls_cluster_internal, Type=ApplicationRuntime><OverallHealthStateJMX>IsCritical
- pattern: "^com.bea<ServerRuntime=(.+), Name=(.+), Type=(.+)Runtime><(.+)>(.+):"
name: weblogic_$3_$4_$5
attrNameSnakeCase: true
labels:
With this the http server starts but no metrics related to weblogic server is retrieved.
This is the output generated:
# HELP jmx_exporter_build_info A metric with a constant '1' value labeled with the version of the JMX exporter.
# TYPE jmx_exporter_build_info gauge
jmx_exporter_build_info{version="0.12.0",name="jmx_prometheus_httpserver",} 1.0
# HELP jmx_scrape_duration_seconds Time this JMX scrape took, in seconds.
# TYPE jmx_scrape_duration_seconds gauge
jmx_scrape_duration_seconds 0.015413622
# HELP jmx_scrape_error Non-zero if this scrape failed.
# TYPE jmx_scrape_error gauge
jmx_scrape_error 1.0
# 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 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
Tried various options to provide the hostPort / jmxURL
1) (The host port here are the jmx server and port)
username: weblogic
password: **********
ssl: false
Got error:
SEVERE: JMX scrape failed: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root e
SEVERE: JMX scrape failed: java.net.MalformedURLException: Unsupported protocol: t3
2) (The host port here are the JMX server and port)
username: weblogic
password: **********
ssl: false
No errors obtained, but no wl server metrics returned
3) (The host port here are the weblogic server and port)
username: weblogic
password: **********
ssl: false
No errors obtained, but no wl server metrics returned
4) (The host port here are the weblogic server and port)
username: weblogic
password: **********
Got Error
SEVERE: JMX scrape failed: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
5) (The host port here are the jmx server and port)
username: weblogic
password: **********
Got Error
SEVERE: JMX scrape failed: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
6)
(weblogic server host and port)
username: weblogic
password: ***********
7)
(jmx server host and pwd)
username: weblogic
password: **********
None of the above connection options worked.
FYI.. We already tried the java agent variant and were able to collect the weblogic server metrics. But we could not scale because
1. The java agent option has to be embedded in every managed server
2. server had to be restarted
3. every server's metrics has to be collected from different port
4. This requires the port to be open from the prometheus server to the weblogic server where jmx exporter java agent is configured.
This is not a scalable option.