-
Notifications
You must be signed in to change notification settings - Fork 210
Spring Boot Starter Live Metrics and Logback not working #828
Description
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.2to dependencies - Add
com.microsoft.azure:applicationinsights-logging-logback:2.3.1to 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.