Skip to content

Access issues when starting the Java Agent #2031

Closed
@tommskar

Description

@tommskar

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

  1. Setup an Azure Web App along with Azure Application Insights
  2. Stop the web app
  3. Upload Java Agent to /site/wwwroot/appinsights
  4. Add environment variable JAVA_OPTS and set it to -javaagent:D:\home\site\wwwroot\appinsights\applicationinsights-agent-3.2.4.jar
  5. Add environment variable APPLICATIONINSIGHTS_CONNECTION_STRING and set it to your Application Insights key (InstrumentationKey=...).
  6. Start the web app
  7. Let it run for a bit
  8. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions