Skip to content

Commit 7f0d67b

Browse files
Merge pull request #267446 from jcocchi/update-otel
Cosmos DB: update Cosmos OTel docs
2 parents eac2a32 + 2f0b12a commit 7f0d67b

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

articles/azure-monitor/app/asp-net-dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Application Insights SDKs for .NET and .NET Core ship with `DependencyTrackingTe
2828
|[Azure Blob Storage, Table Storage, or Queue Storage](https://www.nuget.org/packages/WindowsAzure.Storage/) | Calls made with the Azure Storage client. |
2929
|[Azure Event Hubs client SDK](https://nuget.org/packages/Azure.Messaging.EventHubs) | Use the latest package: https://nuget.org/packages/Azure.Messaging.EventHubs. |
3030
|[Azure Service Bus client SDK](https://nuget.org/packages/Azure.Messaging.ServiceBus)| Use the latest package: https://nuget.org/packages/Azure.Messaging.ServiceBus. |
31-
|[Azure Cosmos DB](https://www.nuget.org/packages/Microsoft.Azure.Cosmos) | Tracked automatically if HTTP/HTTPS is used. TCP will also be captured automatically using preview package >= [3.33.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0-preview). |
31+
|[Azure Cosmos DB](https://www.nuget.org/packages/Microsoft.Azure.Cosmos) | Tracked automatically if HTTP/HTTPS is used. Tracing for operations in direct mode with TCP will also be captured automatically using preview package >= [3.33.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0-preview). For more details visit the [documentation](../../cosmos-db/nosql/sdk-observability.md). |
3232

3333
If you're missing a dependency or using a different SDK, make sure it's in the list of [autocollected dependencies](#dependency-auto-collection). If the dependency isn't autocollected, you can track it manually with a [track dependency call](./api-custom-events-metrics.md#trackdependency).
3434

articles/cosmos-db/nosql/sdk-observability.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: cosmos-db
66
ms.subservice: nosql
77
ms.custom: build-2023
88
ms.topic: how-to
9-
ms.date: 05/09/2023
9+
ms.date: 02/27/2024
1010
ms.author: jucocchi
1111
ms.reviewer: jucocchi
1212
---
@@ -22,7 +22,8 @@ Distributed tracing is available in the following SDKs:
2222

2323
|SDK |Supported version |Notes |
2424
|----|------------------|------|
25-
|.NET v3 SDK |[>= `3.33.0-preview`](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0-preview) |This feature is on by default if you're using a supported preview SDK version. You can disable tracing by setting `IsDistributedTracingEnabled = false` in `CosmosClientOptions`. |
25+
|.NET v3 SDK |[>= `3.36.0`](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0) |This feature is available in both preview and non-preview versions. For non-preview versions it's off by default. You can enable tracing by setting `IsDistributedTracingEnabled = false` in `CosmosClientOptions.CosmosClientTelemetryOptions`. |
26+
|.NET v3 SDK preview |[>= `3.33.0-preview`](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0-preview) |This feature is available in both preview and non-preview versions. For preview versions it's on by default. You can disable tracing by setting `IsDistributedTracingEnabled = true` in `CosmosClientOptions.CosmosClientTelemetryOptions`. |
2627
|Java v4 SDK |[>= `4.43.0`](https://mvnrepository.com/artifact/com.azure/azure-cosmos/4.43.0) | |
2728

2829
## Trace attributes
@@ -51,12 +52,29 @@ If you've configured logs in your trace provider, you can automatically get [dia
5152

5253
### [.NET](#tab/dotnet)
5354

54-
In addition to getting diagnostic logs for failed requests, point operations that take over 100 ms and query operations that take over 500 ms also generate diagnostics. You can configure the log level to control which diagnostics logs you receive.
55+
In addition to getting diagnostic logs for failed requests, you can configure different latency thresholds for when to collect diagnostics from successful requests. The default values are 100 ms for point operations and 500 ms for non point operations and can be adjusted through client options.
56+
57+
```csharp
58+
CosmosClientOptions options = new CosmosClientOptions()
59+
{
60+
CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions()
61+
{
62+
DisableDistributedTracing = false,
63+
CosmosThresholdOptions = new CosmosThresholdOptions()
64+
{
65+
PointOperationLatencyThreshold = TimeSpan.FromMilliseconds(100),
66+
NonPointOperationLatencyThreshold = TimeSpan.FromMilliseconds(500)
67+
}
68+
},
69+
};
70+
```
71+
72+
You can configure the log level to control which diagnostics logs you receive.
5573

5674
|Log Level |Description |
5775
|----------|------------|
5876
|Error | Logs for errors only. |
59-
|Warning | Logs for errors and high latency requests. |
77+
|Warning | Logs for errors and high latency requests based on configured thresholds. |
6078
|Information | There are no specific information level logs. Logs in this level are the same as using Warning. |
6179

6280
Depending on your application environment, there are different ways to configure the log level. Here's a sample configuration in `appSettings.json`:

0 commit comments

Comments
 (0)