在Application Insights-Java Application中未跟踪依赖关系

在Application Insights-Java Application中未跟踪依赖关系,java,azure,dependencies,azure-application-insights,appinsights,Java,Azure,Dependencies,Azure Application Insights,Appinsights,我们一直在使用Java应用程序的以下文档进行应用程序洞察的依赖项跟踪: 我们目前使用的版本是: Application Insights Agent和applicationinsights web auto位于 POM.xml文件-2.6.1 MySQL连接器-5.1.31 将以下文件(AI-Agents.xml、ApplicationInsights.xml和ApplicationInsights-agent-2.6.1.jar)添加到 /主页/站点/wwwroot/ 下面的所有尝试都

我们一直在使用Java应用程序的以下文档进行应用程序洞察的依赖项跟踪:

我们目前使用的版本是:

  • Application Insights Agent和applicationinsights web auto位于 POM.xml文件-2.6.1
  • MySQL连接器-5.1.31
将以下文件(AI-Agents.xml、ApplicationInsights.xml和ApplicationInsights-agent-2.6.1.jar)添加到

/主页/站点/wwwroot/

下面的所有尝试都是在Windows和Linux应用程序服务上进行的

在本地,在IDE(IntelliJ)中,当我们将所有这些文件添加到resources文件夹中,并使用在VM选项中配置的上述文件运行应用程序时,可以毫无问题地跟踪依赖关系。但是,在应用程序服务上复制相同的配置会显示以下异常

是否有人建议是否缺少任何配置,或者是否需要进一步的配置才能使自动依赖项跟踪工作正常

多谢各位

2020-08-18T11:18:54.583510165Z: [ERROR]         org.apache.catalina.LifecycleException: Failed to start component [/ApplicationInsights]
2020-08-18T11:18:54.583515565Z: [ERROR]                 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
2020-08-18T11:18:54.583519665Z: [ERROR]                 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
2020-08-18T11:18:54.583523465Z: [ERROR]                 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
2020-08-18T11:18:54.583555865Z: [ERROR]                 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
2020-08-18T11:18:54.583569265Z: [ERROR]                 at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:624)
2020-08-18T11:18:54.583573565Z: [ERROR]                 at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1833)
2020-08-18T11:18:54.583577365Z: [ERROR]                 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2020-08-18T11:18:54.583581365Z: [ERROR]                 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-08-18T11:18:54.583585065Z: [ERROR]                 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-18T11:18:54.583588965Z: [ERROR]                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-18T11:18:54.583592665Z: [ERROR]                 at java.lang.Thread.run(Thread.java:748)
Application Insights文件中的内容:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
   <!-- The key from the portal: -->
   <InstrumentationKey>** Your instrumentation key **</InstrumentationKey>
   <!-- HTTP request component (not required for bare API) -->
   <TelemetryModules>
      <Add type="com.microsoft.applicationinsights.web.extensibility.modules.WebRequestTrackingTelemetryModule"/>
      <Add type="com.microsoft.applicationinsights.web.extensibility.modules.WebSessionTrackingTelemetryModule"/>
      <Add type="com.microsoft.applicationinsights.web.extensibility.modules.WebUserTrackingTelemetryModule"/>
   </TelemetryModules>
   <!-- Events correlation (not required for bare API) -->
   <!-- These initializers add context data to each event -->
   <TelemetryInitializers>
      <Add type="com.microsoft.applicationinsights.web.extensibility.initializers.WebOperationIdTelemetryInitializer"/>
      <Add type="com.microsoft.applicationinsights.web.extensibility.initializers.WebOperationNameTelemetryInitializer"/>
      <Add type="com.microsoft.applicationinsights.web.extensibility.initializers.WebSessionTelemetryInitializer"/>
      <Add type="com.microsoft.applicationinsights.web.extensibility.initializers.WebUserTelemetryInitializer"/>
      <Add type="com.microsoft.applicationinsights.web.extensibility.initializers.WebUserAgentTelemetryInitializer"/>
   </TelemetryInitializers>
</ApplicationInsights>

**您的检测密钥**
AI代理文件中的内容:

<ApplicationInsightsAgent>
   <Instrumentation>
      <BuiltIn enabled="true">

         <!-- capture logging via Log4j 1.2, Log4j2, and Logback, default is true -->
         <Logging enabled="true" />

         <!-- capture outgoing HTTP calls performed through Apache HttpClient, OkHttp,
              and java.net.HttpURLConnection, default is true -->
         <HTTP enabled="true" W3C="true" enableW3CBackCompat="true"/>

         <!-- capture JDBC queries, default is true -->
         <JDBC enabled="true" />

         <!-- capture Redis calls, default is true -->
         <Jedis enabled="true" />

         <!-- capture query plans for JDBC queries that exceed this value (MySQL, PostgreSQL),
              default is 10000 milliseconds -->
         <MaxStatementQueryLimitInMS>1000</MaxStatementQueryLimitInMS>

      </BuiltIn>
   </Instrumentation>
</ApplicationInsightsAgent>

1000

能否确保已正确安装代理?另外,请确保ApplicationInsights.xml位于Dapplicationinsights.configurationDirectory@KrishnenduGhosh MSFT所指的有效位置-是,代理已正确安装。这是我们在应用程序服务-Dapplicationinsights.configurationDirectory=“/home/site/wwwroot”javaagent:/home/site/wwwroot/applicationinsights-agent-2.6.1.jar中为JAVA_OPTS配置的值。您可以尝试在您的POM.xml中添加一个applicationinsights-core的包依赖项,以用于。使用与applicationinsights web auto相同的版本,即2.6。1@KrishnenduGhosh-MSFT-请查看上面添加到我文章中的Application Insights文件和AI Agent文件中的内容片段。这些是您想要查看的日志记录配置吗?您是否可以确保已正确安装代理?同时,请确保ApplicationInsights.xml位于Dapplicationinsights.configurationDirectory@KrishnenduGhosh MSFT指向的有效位置?是,代理已正确安装。这是我们在应用程序服务-Dapplicationinsights.configurationDirectory=“/home/site/wwwroot”javaagent:/home/site/wwwroot/applicationinsights-agent-2.6.1.jar中为JAVA_OPTS配置的值。您可以尝试在您的POM.xml中添加一个applicationinsights-core的包依赖项,以用于。使用与applicationinsights web auto相同的版本,即2.6。1@KrishnenduGhosh-MSFT-请查看上面添加到我文章中的Application Insights文件和AI Agent文件中的内容片段。这些是您想要查看的日志记录配置吗?