Description
Expected behavior
I expected logging from Logback to appear in Azure Application Insights.
Actual behavior
According to applicationinsights.log
the Java Agent starts just fine but quickly logs warnings/errors indefinitely.
To Reproduce
- Setup an Azure Web App along with Azure Application Insights
- Stop the web app
- Upload Java Agent to
/site/wwwroot/appinsights
- Add environment variable
JAVA_OPTS
and set it to-javaagent:D:\home\site\wwwroot\appinsights\applicationinsights-agent-3.2.4.jar
- Add environment variable
APPLICATIONINSIGHTS_CONNECTION_STRING
and set it to your Application Insights key (InstrumentationKey=...
). - Start the web app
- Let it run for a bit
- Stop the web app and inspect
applicationinsights.log
and Azure Application Insights.
Sample Application
N/A
System information
- Java Version: 1.8.0_292
- Java Agent Version: 3.2.4
- OS type and version: Microsoft Windows NT 10.0.14393.0 (Azure Web App)
- Application Server type and version (if applicable): Tomcat 8.5.57
- Using spring-boot? No
- Additional relevant libraries (with version, if applicable): N/A
Logs
applicationinsights.log
2022-01-04 23:33:59.063Z INFO c.m.applicationinsights.agent - ApplicationInsights Java Agent 3.2.4 started successfully (PID 5472)
2022-01-04 23:34:49.281Z WARN o.s.o.windows.WindowsOperatingSystem - Unable to open configured system Event log "System". Calculating boot time from uptime.
2022-01-04 23:34:50.110Z ERROR o.d.w.r.HkeyPerformanceDataUtil - Error reading performance data from registry for Process.
2022-01-04 23:34:52.329Z WARN o.u.p.w.PerfCounterWildcardQuery - Disabling further attempts to query Process.
2022-01-04 23:34:53.860Z WARN o.u.platform.windows.WmiQueryHandler - COM exception querying Win32_Process WHERE NOT Name LIKE"%_Total", which might not be on your system. Will not attempt to query it again. Error was -2147024891: Access is denied.(HRESULT: 80070005)
2022-01-04 23:34:55.407Z WARN o.u.p.w.PerfCounterWildcardQuery - Disabling further attempts to query Processor Information.
2022-01-04 23:34:55.438Z WARN o.u.platform.windows.WmiQueryHandler - COM exception querying Win32_PerfRawData_Counters_ProcessorInformation WHERE NOT Name LIKE "%_Total", which might not be on your system. Will not attempt to query it again. Error was -2147024891: Access is denied.(HRESULT: 80070005)
2022-01-04 23:35:48.894Z ERROR o.d.w.r.HkeyPerformanceDataUtil - Error reading performance data from registry for Process.
2022-01-04 23:35:50.066Z WARN o.u.platform.windows.WmiQueryHandler - COM exception querying Win32_Process WHERE NOT Name LIKE"%_Total", which might not be on your system. Will not attempt to query it again. Error was -2147024891: Access is denied.(HRESULT: 80070005)
2022-01-04 23:35:50.863Z WARN o.u.platform.windows.WmiQueryHandler - COM exception querying Win32_PerfRawData_Counters_ProcessorInformation WHERE NOT Name LIKE "%_Total", which might not be on your system. Will not attempt to query it again. Error was -2147024891: Access is denied.(HRESULT: 80070005)
2022-01-04 23:36:48.638Z ERROR o.d.w.r.HkeyPerformanceDataUtil - Error reading performance data from registry for Process.
2022-01-04 23:36:48.653Z WARN o.u.platform.windows.WmiQueryHandler - COM exception querying Win32_Process WHERE NOT Name LIKE"%_Total", which might not be on your system. Will not attempt to query it again. Error was -2147024891: Access is denied.(HRESULT: 80070005)
2022-01-04 23:36:48.700Z WARN o.u.platform.windows.WmiQueryHandler - COM exception querying Win32_PerfRawData_Counters_ProcessorInformation WHERE NOT Name LIKE "%_Total", which might not be on your system. Will not attempt to query it again. Error was -2147024891: Access is denied.(HRESULT: 80070005)
Screenshots
N/A
Addendum
This setup works fine locally and it did work fine in Azure when running version 2.x of the Application Insights Java Agent (although it bundled com.microsoft.azure:applicationinsights-web-auto:2.6.1
and used ApplicationInsights.xml
so maybe not entirely comparable). No applicationinsights.json
was included.