gpt4 book ai didi

java - 如何在Spring Boot应用程序中设置变量instrumentationKey以进行a​​zure监控

转载 作者:行者123 更新时间:2023-11-30 05:45:12 25 4
gpt4 key购买 nike

我在 Spring Boot 项目中设置 Azure 监控时遇到问题。

我每次开始时都会遇到错误:

instrumentationKey must be set to report metrics to Azure Monitor.

我已设置 application.properties 具有以下属性:

azure.application-insights.instrumentation-key=VALID-UUID

spring.application.name=test

项目的依赖关系如下:

    <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-spring-boot-metrics-starter</artifactId>
<version>2.1.4</version>
</dependency>

最佳答案

据此https://learn.microsoft.com/en-us/azure/azure-monitor/app/micrometer-java#using-spring-2x您还需要添加 application-insights-springboot-starter 的文档。

否则,您可以将 key 设置为azuremonitor.instrumentationKey。我的建议是添加 application-insights-springboot-starter 以及 azure-spring-boot-metrics-starter

关于java - 如何在Spring Boot应用程序中设置变量instrumentationKey以进行a​​zure监控,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54981797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com