Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot fetch jmx counter for GC with Java SDK agent #952

Closed
usecloud opened this issue Jun 18, 2019 · 4 comments
Closed

Cannot fetch jmx counter for GC with Java SDK agent #952

usecloud opened this issue Jun 18, 2019 · 4 comments
Assignees
Labels
Milestone

Comments

@usecloud
Copy link

Expected behavior

I am trying to fetch data from mbeans about last GC duration but I am receiving error

Actual behavior

RROR 18-06-2019 20:59:52.694+0000, 27(PerformanceCounterContainer-0): Failed to fetch JMX object 'java.lang:type=GarbageCollector,name=PS MarkSweep' with attribute 'LastGcInfo.#duration': 'java.lang.ClassCastException: sun.management.GcInfoCompositeData cannot be cast to javax.management.openmbean.CompositeDataSupport'
ERROR 18-06-2019 20:59:52.695+0000, 27(PerformanceCounterContainer-0): Error while fetching JMX data: 'java.lang.ClassCastException: sun.management.GcInfoCompositeData cannot be cast to javax.management.openmbean.CompositeDataSupport', The PC will be ignored
TRACE 18-06-2019 20:59:52.697+0000, 27(PerformanceCounterContainer-0): Stack trace generated is java.lang.ClassCastException: sun.management.GcInfoCompositeData cannot be cast to javax.management.openmbean.CompositeDataSupport
at com.microsoft.applicationinsights.internal.jmx.JmxDataFetcher.fetch(JmxDataFetcher.java:113)
at com.microsoft.applicationinsights.internal.jmx.JmxDataFetcher.fetch(JmxDataFetcher.java:72)
at com.microsoft.applicationinsights.internal.perfcounter.AbstractJmxPerformanceCounter.report(AbstractJmxPerformanceCounter.java:64)
at com.microsoft.applicationinsights.internal.perfcounter.PerformanceCounterContainer$1.run(PerformanceCounterContainer.java:251)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

To Reproduce

Steps to reproduce the behavior:
My configuration in ApplicationInsight

Sample Application

The application is running on Tomcat 9

System information

Please provide the following information:

  • SDK Version: 2.3.1
  • OS type and version: Linux
  • Application Server type and version (if applicable): Tomcat with Java 8
  • Using spring-boot? no
  • Additional relevant libraries (with version, if applicable):

Logs

Turn on SDK logs and attach/paste them to the issue. If using an application server, also attach any relevant server logs.

Be sure to remove any private information from the logs before posting!

Screenshots

If applicable, add screenshots to help explain your problem.

@littleaj littleaj self-assigned this Jun 21, 2019
@littleaj
Copy link
Contributor

littleaj commented Aug 9, 2019

@usecloud It looks like LastGcInfo.#duration is the issue. I don't think # is a valid name character. Try LastGcInfo.duration. If that doesn't work, please share your perf counter configuration from ApplicationInsights.xml

@JacekCzernik
Copy link

JacekCzernik commented Oct 28, 2019

without # is not working either

@littleaj littleaj added the Bug label Oct 30, 2019
@littleaj littleaj added this to the 2.5.2 milestone Oct 30, 2019
@littleaj
Copy link
Contributor

We've found the issue and plan to fix in the next service release.

@trask trask modified the milestones: 2.5.2, 2.6.0, 2.6.0-BETA Nov 7, 2019
@trask trask added this to the future milestone Jun 10, 2020
@trask trask modified the milestones: future, 3.0.0 Sep 13, 2020
trask added a commit that referenced this issue Sep 21, 2020
@trask
Copy link
Member

trask commented Sep 25, 2020

This is fixed now in Preview.7

@trask trask closed this as completed Sep 25, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants