1

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

我每次开始都有错误:

instrumentationKey 必须设置为向 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>
4

2 回答 2

1

根据此https://docs.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

于 2019-03-06T07:27:44.807 回答
0

按依赖跟踪

您的错误消息来自AzureMonitorConfig

所以我认为关键是修改为

azuremonitor.instrumentationKey
于 2019-03-04T13:16:16.937 回答