Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] AI Integration or Open Telemetry: Design Document #3858

Merged
5 commits merged into from
May 24, 2023
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)
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

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)
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

```mermaid
flowchart TD
classDef orange fill:#f96
classDef blue fill:#6fa8dc
subgraph ClientContextCore
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
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)
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
CreateActivity --> HandlerPipeline
GetResponse --> TriggerDispose(Trigger Dispose of Disagnostic Scope)
kirankumarkolli marked this conversation as resolved.
Show resolved Hide resolved
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
TriggerDispose --> CheckLatencyThreshold{Is high latency/errored response?}
CheckLatencyThreshold -- Yes --> GenerateTraceEvent(Generate <i>Warning</i> or <i>Error</i> Trace Event With Request Diagnostics) --> StopActivity
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
CheckLatencyThreshold -- No --> StopActivity
StopActivity --> SendResponse(Send Response to Caller):::blue
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
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
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
OtherLogic --> GetResponse(Get Response for the request)
SendResponse --> OperationCall

```