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

No JMX metrics #504

Closed
StefanLiebig opened this issue Dec 20, 2017 · 1 comment
Closed

No JMX metrics #504

StefanLiebig opened this issue Dec 20, 2017 · 1 comment

Comments

@StefanLiebig
Copy link

I am trying to setup ai with jmx metrics. I only found a hint how this could work here. So my ApplicationInsights.xml contains this:

    <PerformanceCounters>
        <Jmx>
            <Add objectName="java.lang:type=ClassLoading" attribute="TotalLoadedClassCount"
                 displayName="Loaded Class Count"/>
            <Add objectName="java.lang:type=Memory" attribute="HeapMemoryUsage.used"
                 displayName="Heap Memory Usage-used" type="composite"/>
            <Add objectName="java.lang:type=Threading"
                 attribute="ThreadCount" displayName="Thread Count"/>
            <Add objectName="java.lang:type=GarbageCollector,name=PS MarkSweep"
                 attribute="CollectionCount" displayName="GC MarkSweep Count"/>
            <Add objectName="java.lang:type=GarbageCollector,name=PS Scavenge"
                 attribute="CollectionCount" displayName="GC Scavange Count"/>
        </Jmx>
    </PerformanceCounters>

But the JMX metrics do not appear in azure.
The SDKLogging of the applicationinsights.xml configuration looks like this:

AI: INFO 20-12-2017 09:12, 1: Configuration file has been successfully found as resource
AI: INFO 20-12-2017 09:12, 1: 'MaxTelemetryBufferCapacity': null value is replaced with '500'
AI: INFO 20-12-2017 09:12, 1: 'FlushIntervalInSeconds': null value is replaced with '5'
AI: TRACE 20-12-2017 09:12, 1: Using Http Client version 4.3+
AI: INFO 20-12-2017 09:12, 1: 'Channel.MaxTransmissionStorageCapacityInMB': null value is replaced with '10'
AI: TRACE 20-12-2017 09:12, 1: C:\Users\sli\AppData\Local\Temp\AISDK\native\1.0.9 folder exists
AI: ERROR 20-12-2017 09:12, 1: Failed to load native dll, Windows performance counters will not be used. Please make sure that Visual C++ Redistributable is properly installed: C:\Users\sli\AppData\Local\Temp\AISDK\native\1.0.9\applicationinsights-core-native-win64.dll: Can't find dependent libraries.
AI: ERROR 20-12-2017 09:12, 1: Failed to initialize JNI connection.
AI: INFO 20-12-2017 09:43, 1: Configuration file has been successfully found as resource
AI: INFO 20-12-2017 09:43, 1: 'MaxTelemetryBufferCapacity': null value is replaced with '500'
AI: INFO 20-12-2017 09:43, 1: 'FlushIntervalInSeconds': null value is replaced with '5'
AI: INFO 20-12-2017 09:43, 1: 'Channel.MaxTransmissionStorageCapacityInMB': null value is replaced with '10'
AI: TRACE 20-12-2017 09:44, 1: C:\Users\sli\AppData\Local\Temp\AISDK\native\1.0.9 folder exists
AI: ERROR 20-12-2017 09:44, 1: Failed to load native dll, Windows performance counters will not be used. Please make sure that Visual C++ Redistributable is properly installed: C:\Users\sli\AppData\Local\Temp\AISDK\native\1.0.9\applicationinsights-core-native-win64.dll: Can't find dependent libraries.
AI: ERROR 20-12-2017 09:44, 1: Failed to initialize JNI connection.
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'DeadLockDetector'
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'JvmHeapMemoryUsedPerformanceCounter'
AI: ERROR 20-12-2017 09:44, 1: Failed to create WindowsPerformanceCounterAsPC: 'com.microsoft.applicationinsights.internal.perfcounter.JniPCConnector.addCounter(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;'
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'JSDK_ProcessMemoryPerformanceCounter'
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'JSDK_ProcessCpuPerformanceCounter'
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'DeadLockDetector'
AI: TRACE 20-12-2017 09:44, 1: Failed to store performance counter 'DeadLockDetector', since there is already one
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'JvmHeapMemoryUsedPerformanceCounter'
AI: TRACE 20-12-2017 09:44, 1: Failed to store performance counter 'JvmHeapMemoryUsedPerformanceCounter', since there is already one
AI: ERROR 20-12-2017 09:44, 1: Failed to create WindowsPerformanceCounterAsPC: 'com.microsoft.applicationinsights.internal.perfcounter.JniPCConnector.addCounter(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;'
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'JSDK_ProcessMemoryPerformanceCounter'
AI: TRACE 20-12-2017 09:44, 1: Failed to store performance counter 'JSDK_ProcessMemoryPerformanceCounter', since there is already one
AI: TRACE 20-12-2017 09:44, 1: Registering PC 'JSDK_ProcessCpuPerformanceCounter'
AI: TRACE 20-12-2017 09:44, 1: Failed to store performance counter 'JSDK_ProcessCpuPerformanceCounter', since there is already one

What am I missing?

The web app is running with an embedded jetty and I am using version 1.0.9 (can´t use 1.0.10 because of #502)

@StefanLiebig
Copy link
Author

Found it by myself.

Forgot to start JVM with proper JMX settings. Like here!

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

No branches or pull requests

1 participant