Как установить переменную InstrumentationKey для мониторинга Azure в приложении с весенней загрузкой

У меня проблема с настройкой мониторинга 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>

person RJO    schedule 04.03.2019    source источник
comment
я создаю тестовое приложение с проблемой. здесь github.com/RolfJordi/test-azure-monitoring.   -  person RJO    schedule 04.03.2019


Ответы (2)


Согласно этому https://docs.microsoft.com/en-us/azure/azure-monitor/app/micrometer-java#using-spring-2x документацию также необходимо добавить application-insights-springboot-starter.

В противном случае вы можете установить ключ как azuremonitor.instrumentationKey. Я бы порекомендовал добавить application-insights-springboot-starter вместе с azure-spring-boot-metrics-starter

person Dhaval Doshi    schedule 06.03.2019

Отслеживание по зависимости

Ваше сообщение об ошибке исходит от AzureMonitorConfig

Поэтому я думаю, что ключ должен быть изменен на

azuremonitor.instrumentationKey
person howie    schedule 04.03.2019
comment
я не использую azure-application-insights-spring-boot-starter, а azure-spring-boot-metrics-starter - person RJO; 04.03.2019
comment
Результат был отслежен зависимостью azure-spring-boot-metrics-starter - ›icrometer-registry-azure-monitor -› com.microsoft.azure:applicationinsights-core. Ваше сообщение об ошибке исходит от github.com/micrometer-metrics/micrometer/blob/master/ - person howie; 05.03.2019