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

Unable to contact the REST API at http://localhost:7003 #91

Closed mks27 closed 2 years ago

mks27 commented 4 years ago

hi, i deployed wls-exporter on admin server , it is working fine but when i deployed it on managed server, it is showing results for /wls-exporter but on /wls-exporter/metrics it is giving error -- unable to contact the REST API. can you please tell what is the issue here?

marinakog commented 4 years ago

could you please share your config.yaml file for exporter?

mks27 commented 4 years ago

this is my config.yml :

metricsNameSnakeCase: true queries:

marinakog commented 4 years ago

do you run it behind load balancer? could you please add restPort: 8001 to your config yaml?

mks27 commented 4 years ago

no, i am not running it behind load balancer and i also tried restPort, still it is not working.

marinakog commented 4 years ago

could you please describe your env? is it k8s or standalone, what is the version of monexporter?

mks27 commented 4 years ago

i am directly deploying wls-exporter on weblogic server whose version is 12.2.1.2 and version of wls-exporter is 1.1.1

marinakog commented 4 years ago

just to verify all of your steps:

  1. Start up domain with admin and managed servers (ports 7001,7003)
  2. Download wls-exporter.jar with used config file
  3. Open console and deploy wls-exporter.war app ( select admin, managed servers to deploy)-activate and start web app via console
  4. access to http://yourhost:7001/wls-exporter page - success
  5. access to http://yourhost:7001/wls-exporter/metrics page ( provide creds for wls user) -success
  6. access to managed server http://yourhost:7003/wls-exporter page - success
  7. access to http://yourhost:7003/wls-exporter/metrics page ( provide creds for wls user) -failed?
mks27 commented 4 years ago

yes, these are correct

marinakog commented 4 years ago

could you please attach screenshot with error? and configuration page?

marinakog commented 4 years ago

also if you can rerun it with exporter 1.1.2 version we support right now

mks27 commented 4 years ago

exporter2

exporter1

these are the images of configuration page and error page.

mks27 commented 4 years ago

i tried it with exporter 1.1.2 also, still the same issue.

marinakog commented 4 years ago

as a work around please take a look at your /etc/hosts file ( as root) and add similar to this: 127.0.0.1 localhost.localdomain loghost localhost 10.196.1.6 slc13kef.us.oracle.com slc13kef ( 10.196.1.6) is your IP address , slc13kef is your hostname, try to access your url using ip or hostname instead of localhost

mks27 commented 4 years ago

i am working in windows. how to do that in windows

marinakog commented 4 years ago

https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

mks27 commented 4 years ago

by doing this, i am able to access the page but now i am getting another error:

exporter3

exporter4

marinakog commented 4 years ago

is it possible to try to redeploy wls-exporter app after you changed your hosts file, and insert screenshot for config page, also server logs/out files?

marinakog commented 4 years ago

also make sure your RESTfull management services are active ( go to console ->click domain name -> under Configuration general expend Advanced section, select checkbox RESTfull Management Services) and click save

mks27 commented 4 years ago

this is screenshot of config page: exporter5

and these are error from server.out file: <Apr 6, 2020, 12:33:07,572 PM IST> <[ServletContext@1323205551[app:wls-exporter module:wls-exporter.war path:null spec-version:3.1]] Servlet failed with an Exception com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12 path $ at com.google.gson.JsonParser.parse(JsonParser.java:65) at com.google.gson.JsonParser.parse(JsonParser.java:45) at io.prometheus.wls.rest.LiveConfiguration.toJsonObject(LiveConfiguration.java:185) at io.prometheus.wls.rest.LiveConfiguration.scrapeMetrics(LiveConfiguration.java:181) at io.prometheus.wls.rest.ExporterServlet.getMetrics(ExporterServlet.java:93) Truncated. see log file for complete stacktrace Caused By: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12 path $ at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568) at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409) at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) at com.google.gson.JsonParser.parse(JsonParser.java:60) Truncated. see log file for complete stacktrace

<Apr 6, 2020, 12:33:07,579 PM IST> <Watch "UncheckedException" in module "Module-FMWDFW" with severity "Notice" on server "MWAPPMSRV1" has triggered at Apr 6, 2020 12:33:07 PM IST. Notification details: WatchRuleType: Log WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802')) WatchData: MESSAGE = [ServletContext@1323205551[app:wls-exporter module:wls-exporter.war path:null spec-version:3.1]] Servlet failed with an Exception com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12 path $ at com.google.gson.JsonParser.parse(JsonParser.java:65) at com.google.gson.JsonParser.parse(JsonParser.java:45) at io.prometheus.wls.rest.LiveConfiguration.toJsonObject(LiveConfiguration.java:185) at io.prometheus.wls.rest.LiveConfiguration.scrapeMetrics(LiveConfiguration.java:181) at io.prometheus.wls.rest.ExporterServlet.getMetrics(ExporterServlet.java:93) at io.prometheus.wls.rest.ExporterServlet.displayMetrics(ExporterServlet.java:67) at io.prometheus.wls.rest.ExporterServlet.printMetrics(ExporterServlet.java:61) at io.prometheus.wls.rest.ExporterServlet.displayMetrics(ExporterServlet.java:54) at io.prometheus.wls.rest.PassThroughAuthenticationServlet.doWithAuthentication(PassThroughAuthenticationServlet.java:68) at io.prometheus.wls.rest.ExporterServlet.doGet(ExporterServlet.java:44) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:248) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3683) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326) at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259) at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651) at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270) at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348) at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333) at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54) at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41) at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406) at weblogic.work.ExecuteThread.run(ExecuteThread.java:346) Caused By: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12 path $ at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568) at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409) at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) at com.google.gson.JsonParser.parse(JsonParser.java:60) at com.google.gson.JsonParser.parse(JsonParser.java:45) at io.prometheus.wls.rest.LiveConfiguration.toJsonObject(LiveConfiguration.java:185) at io.prometheus.wls.rest.LiveConfiguration.scrapeMetrics(LiveConfiguration.java:181) at io.prometheus.wls.rest.ExporterServlet.getMetrics(ExporterServlet.java:93) at io.prometheus.wls.rest.ExporterServlet.displayMetrics(ExporterServlet.java:67) at io.prometheus.wls.rest.ExporterServlet.printMetrics(ExporterServlet.java:61) at io.prometheus.wls.rest.ExporterServlet.displayMetrics(ExporterServlet.java:54) at io.prometheus.wls.rest.PassThroughAuthenticationServlet.doWithAuthentication(PassThroughAuthenticationServlet.java:68) at io.prometheus.wls.rest.ExporterServlet.doGet(ExporterServlet.java:44) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:248) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3683) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326) at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259) at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651) at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270) at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348) at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333) at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54) at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41) at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406) at weblogic.work.ExecuteThread.run(ExecuteThread.java:346) SUPP_ATTRS = {severity-value=8, rid=0, partition-id=0, partition-name=DOMAIN} SERVER = MWAPPMSRV1 TIMESTAMP = 1586156587572 USERID = MACHINE = MOSSHARM-IN MSGID = BEA-101020 DATE = Apr 6, 2020, 12:33:07,572 PM IST SUBSYSTEM = HTTP CONTEXTID = 542fbcbf-ac6c-4adb-95c1-0952b8d3e9ef-000000a2 TXID = SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '47' for queue: 'weblogic.kernel.Default (self-tuning)'
WatchAlarmType: AutomaticReset WatchAlarmResetPeriod: 30000

i redeployed it and restful management services are also active but still i am facing same issue.

marinakog commented 4 years ago

if possible to provide screenshot for http:/[yourhostname]:7003/wls-exporter/messages

mks27 commented 4 years ago

exporter6

screenshot for http:/localhost:7003/wls-exporter/messages

marinakog commented 4 years ago

could you please use your machine name? you setup in hosts file or IP?

marinakog commented 4 years ago

http:/[yourhostname]:7003/wls-exporter/messages

mks27 commented 4 years ago

exporter7

marinakog commented 4 years ago

this is so strange, it does not even include JVM metrics in the request. could you please send me screen shot of your deployments in the console?

marinakog commented 4 years ago

how did you generate wls-exporter.war file? another thing to try to replace configuration on managed server to have just JVM part: metricsNameSnakeCase: true queries:

russgold commented 4 years ago

It is clearly not able to get to the REST port. I have pushed a branch named show_query_url to GitHub. Could you try building from source and show me the messages page that you get? It should tell us where the exporter is looking for the REST API.

On Apr 7, 2020, at 1:50 PM, Mohit Kumar Sharma notifications@github.com wrote:

https://user-images.githubusercontent.com/20247450/78702531-5d582f80-7926-11ea-96ee-f44cfc4d7303.PNG — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oracle/weblogic-monitoring-exporter/issues/91#issuecomment-610530775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARPWYEOCOVHOEDZKZOBED3RLNRX5ANCNFSM4LXJZ2BQ.

mks27 commented 4 years ago

@marinakog , initially i downloaded wls-exporter from release page and put my config file in it with the help of shell script provided in release. and i also replaced the configuration with only JVM part but still i got the same error.

mks27 commented 4 years ago

@russgold , i built the war file from source using your mentioned branch named show_query_url and this is the screenshot of messages page:

exporter8

mks27 commented 4 years ago

@russgold , this is the error i am getting:

expo9

expo10

russgold commented 4 years ago

@mks27 the query_url branch adds the query url to the messages page; your output doesn't show it, which makes me suspect that you're not actually using that version. Can you double-check?

mriccell commented 2 years ago

Closing for lack of response