Open blankor1 opened 2 weeks ago
Hi, any update for this?
Also I have two more questions for this code sample: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/20d678b60d8a76ae9f551bf590b1a798c62dd72a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.cs#L22C9-L23C69
Hi, gentle ping on this. Do we have any update for this?
1. Is it possible that it not emit any diagnostic data in all cases? For now I see the doc says if exceed the threshold it will send diagnostic: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/5994b1608bfb9aa47e925e958613e156eddd9b97/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs#L30C9-L35C152
Ref. (this)[https://github.com/Azure/azure-cosmos-dotnet-v3/blob/179d9a4930dcec328c6a37745106e976bdc99a4f/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs#L38], there are 4 cases when diagnostics would be generated: a) Latency Threshold b) RequestCharge Threshold c) Payload Size Threshold d) Exceptions But you should have Event Level as "Warning" should be enabled. Default thresholds are: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/179d9a4930dcec328c6a37745106e976bdc99a4f/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs#L13 These status codes are considered as successful status code: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/179d9a4930dcec328c6a37745106e976bdc99a4f/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs#L62
2. Will there be any performance impact if we set "DisableDistributedTracing" to true?
When you enable this feature, there would be minor performance impact but it should not affect you. By setting this flag as true
, you are actually disabling this feature.
Hi, any update for this?
Also I have two more questions for this code sample: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/20d678b60d8a76ae9f551bf590b1a798c62dd72a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.cs#L22C9-L23C69
- As it already use ConcurrentBag, why we still need to lock the Activites?
- The activity seems only be added not removed? https://github.com/Azure/azure-cosmos-dotnet-v3/blob/20d678b60d8a76ae9f551bf590b1a798c62dd72a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.cs#L68
This code is for demonstration purpose only, just for reference purpose, you can do whatever suits you in your application.
a) Yes, you are right, you can either use ConcurrentBag
or lock the Activities
.
b) It totally depends on your requirement, if you want to collect the activities and use it in certain way (or remove it)
But when I use stable version 3.40.0, the source name seems changed to "Azure.Cosmos". If I still use "Azure.Cosmos.Operation", I can not get the related activity in the listener. Yes, you are right, I am looking into this, I will update you shortly on this.
Describe the bug When I use this sample code:https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs, it works well with previous version.
But when I use stable version 3.40.0, the source name seems changed to "Azure.Cosmos". If I still use "Azure.Cosmos.Operation", I can not get the related activity in the listener.
To Reproduce Use stable version SDK not previou. Set CosmosClientOptions.DisableDistributedTracing = false. Listen to "Azure.Cosmos.Operation"
Expected behavior Can get the activity
Actual behavior Can't get the activity. Only when the source name be changed to "Azure.Cosmos", can I get the activity.
Environment summary SDK Version: 3.40.0 OS Version: windows
Additional context I have an additional two more questions about this feature:
Is it possible that it not emit any diagnostic data in all cases? For now I see the doc says if exceed the threshold it will send diagnostic: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/5994b1608bfb9aa47e925e958613e156eddd9b97/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs#L30C9-L35C152
Will there be any performance impact if we set "DisableDistributedTracing" to true?