Skip to content

Spring Boot Starter Live Metrics and Logback not working #828

@fox918

Description

@fox918

Expected behavior

If a instrumentation key is provided, I expect the Application Insights Spring Boot Starter to send all
telemetry to Application Insights.
This includes Live-Metrics and all Logs as configured for the used logging implementation.

Actual behavior

Only custom events are transmitted to Application Insights.

To Reproduce

  • Spring Boot Application using 2.1.3
  • Add com.microsoft.azure:applicationinsights-spring-boot-starter:1.1.2 to dependencies
  • Add com.microsoft.azure:applicationinsights-logging-logback:2.3.1 to dependencies
  • Add some custom logging using @Autowired TelemetryClient telemetryClient; to the application
  • Add a logback configuration to the classpath
  • Add instrumentation key to configuration yaml:
azure:
  application-insights:
    instrumentation-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
    channel:
      in-process:
        developer-mode: true
  • start application and head over to Application Insights in the Azure Portal
  • No logging metrics appear except the custom events in the "Search"Pane
  • No connection to Live Metrics possible

Workaround

Creating a ApplicationInsights.xml in the classpath allows the metrics to be sent and
allows Live Metrics to be used (without any other change to the code or configuration).
Albeit this is a workaround that fixes the stated problem, it is quite inconvenient. Using
the configuration yaml files allows to easily provision different Instrumentation Keys for different
environments.

System information

Please provide the following information:

  • Spring Boot: 2.1.3
  • applicationinsights-spring-boot-starter: 1.1.2
  • applicationinsights-logging-logback 2.3.1
  • Windows 10
  • Gradle as built script

Logs

In order not to spam only a short excerpt out of my log:
I find this line multiple time in the log, however the ikey does not match the Instrumentation Key provided in the configuration yaml:
04-03-2019 17:08:00.658 [DefaultQuickPulseCoordinator] DEBUG c.m.a.c.d.h.i.e.MainClientExec.log - Executing request POST /QuickPulseService.svc/ping?ikey=yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyy HTTP/1.1

If requested, I can also post a full log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionSpring Boot StarterSpring boot starter issues, feature asks and questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions