oracle / weblogic-monitoring-exporter

WebLogic Monitoring Exporter exposes metrics and monitoring data through REST APIs for consumption by other tools (e.g. Prometheus)
Universal Permissive License v1.0
105 stars 80 forks source link

no main manifest attribute, in wls-exporter-core-2.0.3.jar #158

Closed jijojohn1985 closed 2 years ago

jijojohn1985 commented 2 years ago

I am getting error no main manifest attribute, in wls-exporter-core-2.0.3.jar while running this. Please help if there is any thing wrong with the command syntax. also how do we provide the WebLogic credentials in yml file.

java -jar wls-exporter-core-2.0.3.jar 9405 /opt/pmexporter/wlstconfig.yml

wlstconfig.yml

metricsNameSnakeCase: true
domainQualifier: true
restPort: 7012
queries:
- key: name
  keyName: server
  applicationRuntimes:
    key: name
    keyName: app
    componentRuntimes:
      type: WebAppComponentRuntime
      prefix: webapp_config_
      key: name
      values: [deploymentState, contextRoot, sourceInfo, openSessionsHighCount]
      servlets:
        prefix: weblogic_servlet_
        key: servletName
        values: invocationTotalCount
marinakog commented 2 years ago

it looks like the command you try is not valid. We can run exporter as a web app or sidecar.

marinakog commented 2 years ago

see documentation how to build and run it (https://github.com/oracle/weblogic-monitoring-exporter):

The exporter is available in two forms:

A web application that you deploy to the server from which metrics are to be extracted. You may include a configuration file directly in the WAR file, and you may temporarily modify the configuration in a running system by using a web form. If a coordination configurator is running and configured, that temporary configuration will be sent to all servers configured to use it.

A separate process that is run alongside a server instance. You supply the configuration to such a process with a PUT command, as described below. WebLogic Server Kubernetes Operator versions 3.2 and later have special support for the exporter in this form.

jijojohn1985 commented 2 years ago

Hi @marinakog marinakog

Thanks for the explanation. I just ran the sidecar jar file in my weblogic server and got the below exception. Please help if i am missing some thing.

[root@weblogic]# /java/jdk-11.0.12/bin/java -jar wls-exporter-sidecar-2.0.3.jar Error: Unable to initialize main class com.oracle.wls.exporter.sidecar.Main Caused by: java.lang.NoClassDefFoundError: com/oracle/wls/exporter/WebClientFactory

Thanks, Jijo John

marinakog commented 2 years ago

could you please list the steps to reproduce? Is it specific reason to use it this way? For standalone WLS we use webapp monitoring exporter.

jijojohn1985 commented 2 years ago

Hello @marinakog

I imported the War file to weblogic as application after running this command bash getXXX.sh .

Weblogic url

http://IP:3000/console/console.portal?

Below is the config.yml used with the getXXX.sh script. Do we need to provide any weblogic credential in the yml file. Can you please validate if below is correct.

metricsNameSnakeCase: true
restPort: 3000
queries:
- key: name
  keyName: location
  prefix: wls_server_
  applicationRuntimes:
    key: name
    keyName: app
    componentRuntimes:
      prefix: wls_webapp_config_
      type: WebAppComponentRuntime
      key: name
      values: [deploymentState, contextRoot, sourceInfo, openSessionsHighCount, openSessionsCurrentCount, sessionsOpenedTotalCount, sessionCookieMaxAgeSecs, sessionInvalidationIntervalSecs, sessionTimeoutSecs, singleThreadedServletPoolSize, sessionIDLength, servletReloadCheckSecs, jSPPageCheckSecs]
      servlets:
        prefix: wls_servlet_
        key: servletName
- JVMRuntime:
    prefix: wls_jvm_
    key: name
- executeQueueRuntimes:
    prefix: wls_socketmuxer_
    key: name
    values: [pendingRequestCurrentCount]
- workManagerRuntimes:
    prefix: wls_workmanager_
    key: name
    values: [stuckThreadCount, pendingRequests, completedRequests]
- threadPoolRuntime:
    prefix: wls_threadpool_
    key: name
    values: [executeThreadTotalCount, queueLength, stuckThreadCount, hoggingThreadCount]
- JMSRuntime:
    key: name
    keyName: jmsruntime
    prefix: wls_jmsruntime_
    JMSServers:
      prefix: wls_jms_
      key: name
      keyName: jmsserver
      destinations:
        prefix: wls_jms_dest_
        key: name
        keyName: destination

- persistentStoreRuntimes:
    prefix: wls_persistentstore_
    key: name
- JDBCServiceRuntime:
    JDBCDataSourceRuntimeMBeans:
      prefix: wls_datasource_
      key: name
- JTARuntime:
    prefix: wls_jta_
    key: name

I am getting below error when trying to access the url http://IP:3000/wls-exporter

_From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.5.4 503 Service Unavailable The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay may be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

Note: The existence of the 503 status code does not imply that a server must use it when becoming overloaded. Some servers may wish to simply refuse the connection._

I am new to weblogic , please help

marinakog commented 2 years ago

Hello @jijojohn1985 just to verify your steps

  1. You have started WLS domain and this is the url to your console http://ip:3000/console, correct?
  2. You have logged in to the console and deployed wlsexporter.war file as a regular webapp application to your servers?
  3. the status of exporter webapp is running via console
  4. if exporter webapp is deployed to the admin server and admin server port is 3000 you should be able to access to exporter dashboard using this url : http://IP:3000/wls-exporter. Other servers metrics would be accessible via http://IP:[managedserverport]/wls-exporter
  5. exporter webapp uses basic auth, so you will be asked wls credentials if you click on http://IP:[serverport]/wls-exporter/metrics link located on exporter dashboard , or just paste that link to the browser.
jijojohn1985 commented 2 years ago

Hi @marinakog ,

There is some improvement, i am now able to get the /wls-exporter page which shows the config. After that if i go to /metrics it prompts for credentials and then it throws me 500 error. Please see the screenshot attached

My managed server port was 2002 so i modified the config for port 2002

http://IP:2002/wls-exporter/metrics

Provide wls crdens, then below error comes

10.5.1 500 Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request.

Below is from the error log.

<Oct 26, 2021 1:41:41,201 PM JST> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <1635223301201> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <REST encountered the following error: [Security:090876]PolicyConsumer not configured>

<Oct 26, 2021 1:41:41,206 PM JST> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <1635223301206> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <REST encountered the following error: java.lang.IllegalStateException: [Security:090876]PolicyConsumer not configured

at com.bea.common.security.internal.service.PolicyConsumerServiceImpl$ServiceImpl.getPolicyCollectionHandler(PolicyConsumerServiceImpl.java:121) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at weblogic.security.service.ServiceHandler.invoke(ServiceHandler.java:55) at com.sun.proxy.$Proxy100.getPolicyCollectionHandler(Unknown Source) at weblogic.security.service.JMXPolicyConsumer.getJMXPolicyHandler(JMXPolicyConsumer.java:54) at weblogic.

WebLogic Server Version: 12.2.1.3.0 java -version java version "1.8.0_221"

Thanks, Jijo John

marinakog commented 2 years ago

looks like something wrong with your env. could you please try to change configuration for exporter and remove restPort: 3000.

mriccell commented 2 years ago

Closing this issue due to lack of feedback. Filer has not responded in 2 weeks. If Jijo John or anyone else feels like this issue is still relevant to them, please respond here so that we can reopen this case.