question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't expose weblogic metric use iiop

See original GitHub issue

I want to use jmx_export to expose weblogic jmx.But it can not work when weblogic use iiop.

config.yml

---
jmxUrl: service:jmx:iiop://wls-app.wls-app-dev.svc.cluster.local:7001/jndi/weblogic.management.mbeanservers.domainruntime
whitelistObjectName: ["com.bea:ServerRuntime=Weixin-Server-A01,Name=ThreadPoolRuntime,Location=Weixin-Server-A01,Type=ThreadPoolRuntime"]
username: weblogic
password: XXXXXXXXX
lowercaseOutputName: false
lowercaseOutputLabelNames: false
rules:
  - pattern: ".*"

logs -f

2017-02-09 14:16:13.956:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
2017-02-09 14:16:14.015:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:5556
Feb 09, 2017 2:16:33 PM io.prometheus.jmx.JmxCollector collect
SEVERE: JMX scrape failed: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
	at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
	at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
	at io.prometheus.jmx.JmxScraper.doScrape(JmxScraper.java:96)
	at io.prometheus.jmx.JmxCollector.collect(JmxCollector.java:394)
	at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.findNextElement(CollectorRegistry.java:72)
	at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:87)
	at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:57)
	at java.util.Collections.list(Collections.java:5240)
	at io.prometheus.client.exporter.common.TextFormat.write004(TextFormat.java:17)
	at io.prometheus.client.exporter.MetricsServlet.doGet(MetricsServlet.java:41)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:648)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:365)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
	at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:350)
	at javax.naming.InitialContext.lookup(InitialContext.java:417)
	at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
	at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
	at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
	... 30 more

can some one help me? i want to know weather it’s my mistake and how to solve it? Thanks everybody.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
cfrantsencommented, Feb 15, 2017

@ZhenyangZhao Init parameters, we use migratable servers so each JVM has it’s own IP and the java agent is only bound to it’s own JVMs IP. -javaagent:/opt/prometheus/jmx_exporter/jmx_prometheus_javaagent-0.8-SNAPSHOT.jar=<hostname/IP>:9102:/opt/prometheus/jmx_exporter/weblogic.yaml

Config, this is a work in progress but should be fully functional

---
lowercaseOutputName: true
lowercaseOutputLabelNames: true
whitelistObjectNames:
  - "com.bea:Name=*,Type=ServerRuntime"
  - "com.bea:ServerRuntime=*,Type=ApplicationRuntime,*"
  - "com.bea:ServerRuntime=*,Type=JDBCOracleDataSourceRuntime,*"
  - "com.bea:ServerRuntime=*,Type=JMSDestinationRuntime,*"
  - "com.bea:ServerRuntime=*,Type=SAFRemoteEndpointRuntime,*"
  - "com.bea:ServerRuntime=*,Type=ThreadPoolRuntime,*"

rules:
  - pattern: "^com.bea<ServerRuntime=.+, Name=(.+), Type=JDBCOracleDataSourceRuntime><>(.+): (Running|Suspended|Shutdown|Overloaded|Unknown)$"
    attrNameSnakeCase: true
    name: weblogic_datasource_$2
    value: 1
    labels:
      name: $1
      state: $3

  - pattern: "^com.bea<ServerRuntime=.+, Name=(.+), Type=JDBCOracleDataSourceRuntime><>(.+):"
    attrNameSnakeCase: true
    name: weblogic_datasource_$2
    labels:
      name: $1

  - pattern: "^com.bea<ServerRuntime=.+, Name=(.+), Type=JMSDestinationRuntime, JMSServerRuntime=.+><>(.+):"
    attrNameSnakeCase: true
    name: weblogic_messaging_$2
    labels:
      destination: $1

  - pattern: "^com.bea<ServerRuntime=.+, Name=(.+), Type=SAFRemoteEndpointRuntime><>(.+):"
    attrNameSnakeCase: true
    name: weblogic_messaging_$2
    labels:
      endpoint: $1

  - pattern: "^com.bea<ServerRuntime=.+, Name=ThreadPoolRuntime, Type=ThreadPoolRuntime><>(.+):"
    attrNameSnakeCase: true
    name: weblogic_threadpool_$1

  - pattern: "^com.bea<ServerRuntime=.+, Name=(.+), Type=ApplicationRuntime><HealthStateJMX>(.+): HEALTH_(.+)"
    attrNameSnakeCase: true
    name: weblogic_application_$2
    value: 1
    labels:
      name: $1
      state: $3

  - pattern: "^com.bea<Name=.+, Type=ServerRuntime><HealthStateJMX>(.+): HEALTH_(.+)"
    attrNameSnakeCase: true
    name: weblogic_server_$1
    value: 1
    labels:
      state: $2

  - pattern: "^com.bea<Name=.+, Type=ServerRuntime><>(.+): ([A-Z_]+)$"
    attrNameSnakeCase: true
    name: weblogic_server_$1
    value: 1
    labels:
      state: $2

0reactions
ZhenyangZhaocommented, Feb 16, 2017

@cfrantsen Thank u so much. This issue i will close. @brian-brazil Thank u so much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebLogic Server Known and Resolved Issues
Change Request Number Found In Fixed In CR200627 9.0 CR208373 9.0 9.2 CR214481 9.0 9.2
Read more >
weblogic help needed - Server & Application Monitor (SAM)
I just started using SW for weblogic jvm. I get metrics like heap, pool etc...but what I really need is performance metrics for...
Read more >
WebLogic Server Known and Resolved Issues - setgetweb.com
Workaround or Solution: It is recommended that you do not use the browser Back button to step back into an assistant once changes...
Read more >
Configuring WebLogic monitoring - IBM
The agent displays a comprehensive set of metrics to help you make informed ... Note: Most of the Oracle WebLogic server configuration is...
Read more >
Does Weblogic expose metrics through Jmx - Stack Overflow
The answer is yes. WebLogic Server expose all its configuration and runtime metrics through a JMX interface. See this documentation for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found