Application Insights Dependency tracking with TCP protocol/DirectMode #3446
Replies: 1 comment
-
ref. https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet FYI: Cosmos db SDK and Cosmos REST API are 2 separate libraries. Here, we are talking about, only cosmos db SDK. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm just wondering how clients are implementing Cosmos dependency tracking in Application Insights (AI).
We are using TCP mode and the out-of-box dependency tracking isn't supported.
We have been trying to implement the dependency using a custom
RequestHandler
. We have taken similar approach as done in the AI SDK for Document DB where it inspects the Cosmos URIs and determines the operation name.However, this approach isn't working with Cosmos SDK V3 as the operation names aren't been precisely mapped on our custom request handler. For example, when creating a new document/item using
CreateItemStreamAsync
the Cosmos SDK V3 is building the request asPOST /dbs/myDatabase/colls/myCollection
instead ofPOST /dbs/myDatabase/colls/myCollection/docs
which makes our mapping (same DocumentDB implementaion) to result in an operation name as "Query collection" instead of "Create Document" or "Query Document".Looking the
TelemetryHandler
, I can see that it contains all the information we would be looking for in terms of tracking Cosmos as dependency. It's a shame that we can't take advantage of that.Another alternative to build the correct operation name is having access to the
ResourceType
andOperationType
properties ofRequestMessage
- at least aspublic get
as they are currently defined withinternal
protection level.I'd appreciate if anyone could assist with the following questions, please:
TelemetryHandler
can't be executed/configured form clients using TCP/Direct mode?ResourceType
andOperationType
orResponseMessage.Headers.SubStatusCodeLiteral
?/docs
segment? It is creating the request URI asPOST /dbs/myDatabase/colls/myCollection
insteadPOST /dbs/myDatabase/colls/myCollection/docs
. Looking into the Cosmos REST API endpoints, it doesn't mention thePOST /dbs/myDatabase/colls/myCollection
as an endpoint.Hope to hear from the SDK team about this.
Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions