microsoft / azure-spring-boot

Spring Boot Starters for Azure services
MIT License
374 stars 460 forks source link

Application Insights telemetry for Cosmos DB does not report when using azure-cosmosdb-spring-boot-starter version > 2.1.6 #852

Closed burlesgonewild closed 4 years ago

burlesgonewild commented 4 years ago

Environment

Summary

Application Insights telemetry for Cosmos DB requests does not report when using versions greater than 2.1.6.

Reproduce steps

Setup a service with Spring Boot 2.1.4, Cosmos starter com.microsoft.azure:azure-cosmosdb-spring-boot-starter:2.1.6 and Application Insights starter com.microsoft.azure:applicationinsights-spring-boot-starter:2.6.0-BETA. Configure Application Insights properties. Run service with the startup argument referencing the Application Insights agent. Run traffic through the service and observe Cosmos DB telemetry available in Application Insights. Upgrade the Cosmos DB starter to version 2.1.7. No Cosmos DB telemetry is available.

I also have services that use the latest of all libraries and do not get any Cosmos DB telemetry. For example, Spring Boot 2.2.4 with 'com.microsoft.azure:azure-cosmosdb-spring-boot-starter:2.2.3' and 'com.microsoft.azure:applicationinsights-spring-boot-starter:2.6.0-BETA'.

Expected Results

Application Insights dependency telemetry should be available when using any Cosmos DB starter.

Actual Results

Cosmos DB telemetry is missing in Application Insights when using starter > 2.1.6.

saragluna commented 4 years ago

Thanks for reporting this. We'll look into this soon.

burlesgonewild commented 4 years ago

I have since bypassed the starter completely and am still not getting any telemetry. Project is using com.microsoft.azure:spring-data-cosmosdb:2.2.3.FIX1 directly. I have enabled the cosmosdb.telemetryAllowed flag.

burlesgonewild commented 4 years ago

Working with an engineer from the Application Insights team he was able to figure out that when spring.main.lazy-initialization=true the telemetry web filter was not being registered. Since no requests were being reported, neither was the Cosmos DB traffic. There will be a fix for Application Insights 2.6.1 to address.