Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/SdkDesign.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,32 @@ flowchart LR
ConsistencyWriter --> TCPClient

```
## Distributed Tracing (Preview)

For detail about usage of this feature, please see the [Azure Cosmos DB SDK observability](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet)

```mermaid
flowchart TD
classDef orange fill:#f96
classDef blue fill:#6fa8dc
subgraph ClientContextCore
OpenTelemetryRecorderFactory --> CheckFeatureFlag{<a href='https://github.com/Azure/azure-cosmos-dotnet-v3/blob/3727d4d738cfc24aa372b578fd8ca482a5bc2f3f/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs#L436'>isDistributedTracing</a> Enabled?}
CheckFeatureFlag --> |Yes| CreateActivity(Start an Activity or Child activity with specific kind Using DiagnosticScope<br> and preloaded attributes like containerName, databaseName, operationType)
CreateActivity --> HandlerPipeline
GetResponse --> TriggerDispose(Trigger Dispose of Disagnostic Scope)
TriggerDispose --> CheckLatencyThreshold{Is high latency/errored response?}
CheckLatencyThreshold -- Yes --> GenerateTraceEvent(Generate <i>Warning</i> or <i>Error</i> Trace Event With Request Diagnostics) --> StopActivity
CheckLatencyThreshold -- No --> StopActivity
StopActivity --> SendResponse(Send Response to Caller):::blue
end
OperationRequest[Operation Request]:::blue --> ClientContextCore
subgraph Application
OperationCall(User Application):::orange
end
OperationCall(User Application):::orange --> OperationRequest
CheckFeatureFlag --> |No| HandlerPipeline
HandlerPipeline --> OtherLogic(Goes through TCP/HTTP calls <br> based on Connection Mode):::blue
OtherLogic --> GetResponse(Get Response for the request)
SendResponse --> OperationCall

```