作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 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以进行azure监控,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54981797/
我是一名优秀的程序员,十分优秀!