-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cosmos: Allowing sampling for diagnostics #34915
Cosmos: Allowing sampling for diagnostics #34915
Conversation
API change check APIView has identified API level changes in this PR and created following API reviews. |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java
Outdated
Show resolved
Hide resolved
...-tests/src/test/java/com/azure/cosmos/implementation/directconnectivity/ReflectionUtils.java
Show resolved
Hide resolved
…CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
…CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
…CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
…CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
…ianMeiswinkel/azure-sdk-for-java into users/fabianm/DisableMetrics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one concern on the usage of ThreadLocalRandom
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosItemIdEncodingTest.java
Show resolved
Hide resolved
.../azure-cosmos/src/main/java/com/azure/cosmos/implementation/ClientSideRequestStatistics.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/BridgeInternal.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DiagnosticsProvider.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/BridgeInternal.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
/check-enforcer override |
Failures are known issues in CI pipeline - overriding status checks |
/check-enforcer override |
* Allowing sampling for diagnostics * Updating changelog * Removing left-over * Update sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com> * Update sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com> * Update sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com> * Update sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosClientTelemetryConfig.java Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com> * Fixing build analyze * Code review feedback --------- Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
Description
This PR allows applying sampling for diagnostic capturing in the Cosmos DB SDK. The motivation for adding this capability is to allow tuning the client-side resource consumption overhead that applications allow for diagnostics. Depending on the workload the PCU overhead when enabling diagnostics can be around 15-20 percent - in many workloads it will be significantly lower - but especially for very point-read heavy workloads it can be around 15%. The sampling rate can be modified after Cosmos Client initialization - so the sampling rate can be modified without any restarts being necessary.
Set sampling rate to 25%
Reduce sample rate to 0 - disable all diagnostics
set sample rate to 1 - enable all diagnostics (no sampling anymore)
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines