ApplicationInsights-dotnet icon indicating copy to clipboard operation
ApplicationInsights-dotnet copied to clipboard

[WIP] Support CosmosDb dependency tracking

Open lmolkova opened this issue 3 years ago • 3 comments

Changes

Draft of CosmosDB direct (TCP mode) dependency tracking (coming in future versions of Cosmos DB v3 SDK). Uses attributes outlined here and additional cosmos diagnostics is coming from the specific event source and is tracked as TraceTelemetry.

EventSource verbosity is expected to be low - it will be controlled by CosmosDb customers on CosmosDb side. Cosmos would write it when an operation takes longer than a configurable threshold or when an error happens.

Checklist

  • [ ] CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

Notes for reviewers:

  • We support comment build triggers
    • /AzurePipelines run will queue all builds
    • /AzurePipelines run <pipeline-name> will queue a specific build

lmolkova avatar Jul 22 '22 18:07 lmolkova

/cc @sourabh1007

lmolkova avatar Jul 22 '22 18:07 lmolkova

Why PR headline talk about Cosmos DB "Direct Mode"? is it connection mode specific changes?

sourabh1007 avatar Jul 28 '22 13:07 sourabh1007

Events are loosing diagnostics message while listened by appinsight..below is the log I got

Application Insights Telemetry: {"name":"AppTraces","time":"2022-09-23T17:42:26.1395222Z","iKey":"2fabff39-6a32-42da-9e8f-9fcff7d99c6b","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"DESKTOP-I8MO142","ai.operation.id":"2239023b88bb44b60eab840e1983cded","ai.operation.parentId":"80155111011166ad","ai.internal.sdkVersion":"dotnetc:2.22.0-14","ai.internal.nodeName":"DESKTOP-I8MO142"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"n/a","severityLevel":"Warning","properties":{"EventName":"WriteWarningEvent","EventId":"2","AspNetCoreEnvironment":"Development","DeveloperMode":"true","CategoryName":"Azure.Cosmos"}}}}

Cosmosdb SDK doesn't send n/a.

sourabh1007 avatar Sep 23 '22 17:09 sourabh1007

Events are loosing diagnostics message while listened by appinsight..below is the log I got

Fixed, please check

lmolkova avatar Sep 26 '22 23:09 lmolkova

with latest changes, things are looking good except one minor thing i.e. I am seeing cosmosdb text instead of cosmosdb icon (like we were getting previously)

image

sourabh1007 avatar Sep 27 '22 16:09 sourabh1007

with latest changes, things are looking good except one minor thing i.e. I am seeing cosmosdb text instead of cosmosdb icon (like we were getting previously)

for this we need portal team to support Azure CosmosDB (in addition to DocumentDB) - there is nothing I can do on SDK side

lmolkova avatar Sep 27 '22 16:09 lmolkova

with latest changes, things are looking good except one minor thing i.e. I am seeing cosmosdb text instead of cosmosdb icon (like we were getting previously)

for this we need portal team to support Azure CosmosDB (in addition to DocumentDB) - there is nothing I can do on SDK side

but previously this icon was coming. in this latest package only it is not showing up

sourabh1007 avatar Sep 28 '22 21:09 sourabh1007

Thank you @reyang and @cijothomas for the review! I believe I addressed all the feedback in the code. PTAL.

As for documentation, I updated the description on this PR, just need to add a few details.

@sourabh1007, can you please help us clarify the following:

  • Exact Cosmos DB version that supports tracing
  • Is there an example on how to enable and configure tracing? Can you share it or provide a link to existing samples/docs, anything?

Thanks!

lmolkova avatar Oct 25 '22 20:10 lmolkova