Spring boot 如何使用SpringBoot通过应用程序洞察跟踪RestTemplate和JDBC依赖关系?

Spring boot 如何使用SpringBoot通过应用程序洞察跟踪RestTemplate和JDBC依赖关系?,spring-boot,azure-application-insights,Spring Boot,Azure Application Insights,根据文档,在Spring Boot应用程序中进行的RestTemplate和JDBC调用应该“自动”跟踪,并配置应用程序洞察。我可以在AI中看到我的日志,但看不到预期的依赖项 我跟着台阶走了 在“从基于XML的配置迁移”一节中,它指导您遵循以下步骤,但随后只提到使用XML配置 这也是它提到RestTemplate和JDBC调用应该在“没有任何代码更改”的情况下自动跟踪的地方,但我没有看到它 正在Windows应用程序服务上运行 <dependency> <groupId&g

根据文档,在Spring Boot应用程序中进行的RestTemplate和JDBC调用应该“自动”跟踪,并配置应用程序洞察。我可以在AI中看到我的日志,但看不到预期的依赖项

我跟着台阶走了

在“从基于XML的配置迁移”一节中,它指导您遵循以下步骤,但随后只提到使用XML配置

这也是它提到RestTemplate和JDBC调用应该在“没有任何代码更改”的情况下自动跟踪的地方,但我没有看到它

正在Windows应用程序服务上运行

<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>applicationinsights-spring-boot-starter</artifactId>
  <version>1.1.1</version>
</dependency>
<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>applicationinsights-logging-logback</artifactId>
  <version>[2.0,)</version>
</dependency>

azure:
  application-insights:
    enabled: true
    instrumentation-key: <mykey>
    web:
      enabled: true
      w3c: true
    logger:
      type: console
      level: info
    default-modules:
      ProcessPerformanceCountersModule:
        enabled: true
      JvmPerformanceCountersModule:
        enabled: true
      WebRequestTrackingTelemetryModule:
        enabled: true
      WebSessionTrackingTelemetryModule:
        enabled: true
      WebUserTrackingTelemetryModule:
        enabled: true
      WebPerformanceCounterModule:
        enabled: true
      WebOperationIdTelemetryInitializer:
        enabled: true
      WebOperationNameTelemetryInitializer:
        enabled: true
      WebSessionTelemetryInitializer:
        enabled: true
      WebUserTelemetryInitializer:
        enabled: true
      WebUserAgentTelemetryInitializer:
        enabled: true

com.microsoft.azure
应用程序指示灯弹簧启动启动器
1.1.1
com.microsoft.azure
applicationinsights日志回写
[2.0,)
蔚蓝:
应用见解:
已启用:true
仪表键:
网状物:
已启用:true
w3c:没错
记录器:
类型:控制台
级别:信息
默认模块:
ProcessPerformanceCountersModule:
已启用:true
JVM性能计数器模块:
已启用:true
WebRequestTrackingTelemetryModule:
已启用:true
WebSessionTrackingTelemetryModule:
已启用:true
WebUserTrackingTelemetryModule:
已启用:true
WebPerformanceCounterModule:
已启用:true
WebOperationIdTelemetryInitializer:
已启用:true
WebOperationNameTelemetryInitializer:
已启用:true
WebSessionTelemetryInitializer:
已启用:true
WebUserTelemetryInitializer:
已启用:true
WebUserAgentElemetryInitializer:
已启用:true
不确定它是否相关,但我正在本地运行它,并连接到我的app insights实例以检查日志记录。我在启动过程中看到以下内容:

AI:INFO 16-01-2019 14:28:38.268+0000,18(localhost-startStop-1):类路径上不存在指定的类com.microsoft.applicationinsights.agent.internal.coresync.AgentNotificationsHandler
AI:INFO 16-01-2019 14:28:38.268+0000,18(localhost-startStop-1):找不到代理。跳过0.412ms中的代理注册这不是错误,只是表明您基本上还需要使用ApplicationInsightsJavaAgent来收集依赖项。添加代理的相关文档是。我还回答了您在此处创建的Github问题。

这不是错误,而是错误仅表明您基本上还需要使用ApplicationInsightsJavaAgent来收集依赖项。要添加代理的相关文档为。我还就您在此处创建的Github问题回答了这个问题。

谢谢Dhaval。我没有将这个问题标记为完整,因为我在将代理部署到我的Windows应用程序服务。当我在我的应用程序服务上添加其中一个或java进程时无法启动。经过一些尝试和错误后,CATALINA_选择-javaagent:“D:\locationofagentjar”我在运行Tomcat 8.5 Thank you Dhaval的windows应用程序服务上工作。我没有将这个问题标记为完整问题,因为我在将代理部署到windows应用程序服务时仍然存在问题。当我添加其中一个或在我的应用程序服务上的java进程无法启动时。经过一些尝试和错误后,CATALINA_选择使用-javaagent:“D:\locationofagentjar”在运行Tomcat 8.5的windows应用程序服务上工作