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

Cosmos: Diagnostic improvements #33209

Merged
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
5d126e7
Initial DRAFT for public API review
FabianMeiswinkel Jan 30, 2023
d53acc3
Update DiagnosticsProvider.java
FabianMeiswinkel Jan 30, 2023
3519b0a
Adding comments
FabianMeiswinkel Jan 30, 2023
65ecd09
Iterate on comments
FabianMeiswinkel Jan 30, 2023
501ddf0
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Feb 20, 2023
b847734
Merging main into PR
FabianMeiswinkel Feb 20, 2023
d21ca51
Implementing CosmosDiagnosticsContext.toString (including caching)
FabianMeiswinkel Feb 20, 2023
8228edf
Iterating on implementation
FabianMeiswinkel Feb 20, 2023
45824b0
Fixing SpotBug issues
FabianMeiswinkel Feb 20, 2023
786d0df
Fixing SpotBug violations
FabianMeiswinkel Feb 20, 2023
eaa916b
Fixing java doc violation
FabianMeiswinkel Feb 21, 2023
2064c94
Fixing unit test failures
FabianMeiswinkel Feb 21, 2023
07774ea
Fixing test failures
FabianMeiswinkel Feb 21, 2023
9b4867b
Refactoring to allow specifying thresholds on config and requestOptions
FabianMeiswinkel Feb 21, 2023
228fdae
Update CosmosDiagnosticsThresholds.java
FabianMeiswinkel Feb 21, 2023
be5c48d
Update CosmosItemRequestOptions.java
FabianMeiswinkel Feb 22, 2023
e7a34b9
Update DiagnosticsProvider.java
FabianMeiswinkel Feb 22, 2023
1e180a7
Allowing configuration of status code handling
FabianMeiswinkel Feb 22, 2023
d19302b
Update CosmosDiagnosticsThresholds.java
FabianMeiswinkel Feb 22, 2023
6284527
Update CosmosClientTelemetryConfig.java
FabianMeiswinkel Feb 23, 2023
da445fc
Allowing to configure log levels
FabianMeiswinkel Feb 24, 2023
6a98a8b
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Feb 27, 2023
bb87153
Temp
FabianMeiswinkel Feb 27, 2023
ea0f975
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 1, 2023
96cff8d
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 2, 2023
6e50318
Update ImplementationBridgeHelpers.java
FabianMeiswinkel Mar 2, 2023
bc61d50
Removing TracerProvider and starting to switch to DiagnosticsProvider
FabianMeiswinkel Mar 3, 2023
e54230f
Iterating on DiagnosticsProvider
FabianMeiswinkel Mar 3, 2023
89e35c8
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 3, 2023
03f8eca
Addressing SpotBug failures
FabianMeiswinkel Mar 3, 2023
d2a8ced
Update CosmosDiagnosticsThresholds.java
FabianMeiswinkel Mar 3, 2023
785a224
Update CosmosPagedFlux.java
FabianMeiswinkel Mar 3, 2023
7c6a5f3
Update CosmosDiagnosticsContext.java
FabianMeiswinkel Mar 3, 2023
18ff41e
Fixing test regressions
FabianMeiswinkel Mar 4, 2023
5014f48
Adding transport level traces
FabianMeiswinkel Mar 4, 2023
6378db6
Update spotbugs-exclude.xml
FabianMeiswinkel Mar 6, 2023
842ba65
Iterating on tests
FabianMeiswinkel Mar 7, 2023
72c585a
Update BridgeInternal.java
FabianMeiswinkel Mar 7, 2023
b12111b
Iterating on tests
FabianMeiswinkel Mar 7, 2023
770150d
Update ClientTelemetryDiagnosticsHandler.java
FabianMeiswinkel Mar 7, 2023
a209fef
Iterating on tests
FabianMeiswinkel Mar 7, 2023
3d2cbed
Iterating on tests
FabianMeiswinkel Mar 8, 2023
e82983a
Iterating on tests
FabianMeiswinkel Mar 8, 2023
19ea581
Iterating on tests
FabianMeiswinkel Mar 8, 2023
0602b1b
Iterating on tests
FabianMeiswinkel Mar 8, 2023
67a97cd
Iterating on tests
FabianMeiswinkel Mar 9, 2023
ffa02a4
Update CosmosTracerTest.java
FabianMeiswinkel Mar 10, 2023
5b9ccd2
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 10, 2023
7c44733
CosmosTracerTest finished
FabianMeiswinkel Mar 10, 2023
e0f9825
Update CosmosTracerTest.java
FabianMeiswinkel Mar 10, 2023
13b3961
Update CosmosTracerTest.java
FabianMeiswinkel Mar 10, 2023
fa79bcd
Addressing Linting issues
FabianMeiswinkel Mar 11, 2023
0872a71
Delete TracerProviderTest.java
FabianMeiswinkel Mar 11, 2023
4ee0ea5
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 16, 2023
09939bd
Update AsyncBenchmark.java
FabianMeiswinkel Mar 16, 2023
7e25e20
Update ClientTelemetry.java
FabianMeiswinkel Mar 16, 2023
2ae2fdf
Update ClientTelemetry.java
FabianMeiswinkel Mar 17, 2023
3a30041
Update ClientTelemetry.java
FabianMeiswinkel Mar 17, 2023
373a857
Updating tests
FabianMeiswinkel Mar 17, 2023
5c51e67
Fixing test
FabianMeiswinkel Mar 17, 2023
e9af339
Changed ClientSideRequestStatistics to Set from List in FeedResponseD…
kushagraThapar Mar 17, 2023
4255a87
Update CosmosDiagnosticsContext.java
FabianMeiswinkel Mar 17, 2023
88b3646
Merge branch 'fix_duplicate_diagnostics_on_query_api' of https://gith…
FabianMeiswinkel Mar 17, 2023
a71bc4c
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 17, 2023
c1071e8
Pushing query diagnostics duplication ifx
FabianMeiswinkel Mar 17, 2023
902c4a3
Update CosmosDiagnosticsContext.java
FabianMeiswinkel Mar 18, 2023
2b849a4
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 21, 2023
57826f4
Fixing regression that changed the order of diagnostics in Feed opera…
FabianMeiswinkel Mar 22, 2023
ec423c5
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 22, 2023
63fc382
Fixing build break regarding haddop/winutils
FabianMeiswinkel Mar 23, 2023
fc0de6c
Update cosmos-sdk-client.yml
FabianMeiswinkel Mar 23, 2023
858c7e5
Prettifying code
FabianMeiswinkel Mar 23, 2023
21a0338
Fixing unit test failures
FabianMeiswinkel Mar 23, 2023
62a4a8a
Reverting public surface area changes to BridgeInternal
FabianMeiswinkel Mar 23, 2023
e927d1f
More BridgeInternal cleanup
FabianMeiswinkel Mar 23, 2023
64014b8
More BridgeInternal cleanup
FabianMeiswinkel Mar 23, 2023
7c64d2f
Fixing build breaks
FabianMeiswinkel Mar 23, 2023
6995682
Another Build break fix
FabianMeiswinkel Mar 23, 2023
ca7c2a9
Update Utils.java
FabianMeiswinkel Mar 23, 2023
4e9066f
Cleaning up CosmosAsyncClient
FabianMeiswinkel Mar 23, 2023
9b2c603
Fixing build regression and more clean-up
FabianMeiswinkel Mar 23, 2023
1d8824c
More cleanup
FabianMeiswinkel Mar 23, 2023
9bd6abb
<p> -> <br/> in javadoc
FabianMeiswinkel Mar 23, 2023
539d1e2
Update DistinctClientSideRequestStatisticsCollection.java
FabianMeiswinkel Mar 23, 2023
c1edb49
Update CosmosAsyncContainer.java
FabianMeiswinkel Mar 23, 2023
0b40bc1
Addressing linitng error in RxDoucmentClinetImpl
FabianMeiswinkel Mar 24, 2023
df9370a
Moving to latest semantic profile attributes
FabianMeiswinkel Mar 24, 2023
ed7b311
Update DiagnosticsProvider.java
FabianMeiswinkel Mar 24, 2023
f9d6960
Update CosmosTracerTest.java
FabianMeiswinkel Mar 24, 2023
ec71966
Update CosmosDiagnosticsContext.java
FabianMeiswinkel Mar 24, 2023
87f23bf
Fixes unit test failures
FabianMeiswinkel Mar 24, 2023
343f1e8
Adding test to validate InjectedFailureId in request trace
FabianMeiswinkel Mar 24, 2023
391b0fb
Pushing tests into its own module
FabianMeiswinkel Mar 24, 2023
82c3748
Update ci.yml
FabianMeiswinkel Mar 24, 2023
59cdb5b
Update cosmos-sdk-client.yml
FabianMeiswinkel Mar 24, 2023
9989c0d
Update version_client.txt
FabianMeiswinkel Mar 24, 2023
3999412
Merge branch 'users/fabianm/DiagnosticsProcessor' of https://github.c…
FabianMeiswinkel Mar 24, 2023
48ad222
Update pom.xml
FabianMeiswinkel Mar 24, 2023
eb82677
Update pom.xml
FabianMeiswinkel Mar 24, 2023
9e4f57f
Update README.md
FabianMeiswinkel Mar 24, 2023
d19930c
Update AzureCosmosPropertiesTest.java
FabianMeiswinkel Mar 24, 2023
8702095
Adding back test resources to azure-cosmos
FabianMeiswinkel Mar 25, 2023
e23cbce
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 25, 2023
cde1c42
Update HttpPipelineBuilder.java
FabianMeiswinkel Mar 25, 2023
30ed65e
Extending Tracer test coverage
FabianMeiswinkel Mar 27, 2023
ec6c59c
Extending test coverage
FabianMeiswinkel Mar 27, 2023
e3f5193
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel Mar 27, 2023
157b9b4
Prettifying code
FabianMeiswinkel Mar 27, 2023
2bd2621
Adding unit test for tracing with retries
FabianMeiswinkel Mar 28, 2023
f67e91e
Extending Benchmark to also allow logging
FabianMeiswinkel Mar 28, 2023
e9c4337
Adding switch to disable tracing in benchmark
FabianMeiswinkel Mar 28, 2023
05eb966
Revert "Adding switch to disable tracing in benchmark"
FabianMeiswinkel Mar 28, 2023
b975e99
Adding User Agent suffix
FabianMeiswinkel Mar 28, 2023
628f3d0
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
4c9701b
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
5e9e3d8
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
b883b00
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
6e7159c
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
329400a
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
7edbf1d
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
9853784
Update AsyncBenchmark.java
FabianMeiswinkel Mar 28, 2023
7bf4f12
Update CosmosTracerTest.java
FabianMeiswinkel Mar 29, 2023
280497f
Update CosmosTracerTest.java
FabianMeiswinkel Mar 29, 2023
a50f4ae
Update CosmosTracerTest.java
FabianMeiswinkel Mar 29, 2023
e819ce7
Update TestSuiteBase.java
FabianMeiswinkel Mar 30, 2023
85e71a6
Update CosmosDiagnosticsContext.java
FabianMeiswinkel Mar 30, 2023
14e829e
Update TestSuiteBase.java
FabianMeiswinkel Mar 30, 2023
1b70902
Update CosmosItemIdEncodingTest.java
FabianMeiswinkel Mar 30, 2023
ece1f59
Update TestSuiteBase.java
FabianMeiswinkel Mar 30, 2023
e23d1e1
Update TestSuiteBase.java
FabianMeiswinkel Mar 30, 2023
5d41136
Reacting to API review board feedback
FabianMeiswinkel Mar 31, 2023
f065846
Update AsyncBenchmark.java
FabianMeiswinkel Mar 31, 2023
cb62fc2
Update CosmosDiagnosticsE2ETest.java
FabianMeiswinkel Mar 31, 2023
e92ae0d
Update SyncBenchmark.java
FabianMeiswinkel Mar 31, 2023
5afc371
Fixing JavaDoc issues
FabianMeiswinkel Mar 31, 2023
2848451
Fixing test failures
FabianMeiswinkel Mar 31, 2023
dc979b8
Addressing code review feedback
FabianMeiswinkel Apr 1, 2023
9ef48cb
Update ThroughputControlTests.java
FabianMeiswinkel Apr 1, 2023
6b0b1ff
Update CosmosItemIdEncodingTest.java
FabianMeiswinkel Apr 1, 2023
52aa194
Reverting changes to truncateCollection
FabianMeiswinkel Apr 2, 2023
c616407
Update TestSuiteBase.java
FabianMeiswinkel Apr 2, 2023
9e24546
Revert "Update TestSuiteBase.java"
FabianMeiswinkel Apr 2, 2023
7564aeb
Update CosmosTracerTest.java
FabianMeiswinkel Apr 2, 2023
0fd26c1
Update CosmosItemTest.java
FabianMeiswinkel Apr 2, 2023
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
1 change: 1 addition & 0 deletions eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,7 @@
<Match>
<Or>
<Class name="~com.azure.cosmos.implementation.ImplementationBridgeHelpers(\$.*)?"/>
<Class name="~com.azure.cosmos.implementation.DiagnosticsProvider(\$.*)?"/>
<Class name="~com.azure.cosmos.test.implementation.ImplementationBridgeHelpers(\$.*)?"/>
</Or>
<Bug pattern="DM_EXIT"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.azure.cosmos.implementation.CosmosError;
import com.azure.cosmos.implementation.DatabaseAccount;
import com.azure.cosmos.implementation.DiagnosticsClientContext;
import com.azure.cosmos.implementation.DiagnosticsProvider;
import com.azure.cosmos.implementation.Document;
import com.azure.cosmos.implementation.FeedResponseDiagnostics;
import com.azure.cosmos.implementation.GlobalEndpointManager;
Expand All @@ -27,7 +28,6 @@
import com.azure.cosmos.implementation.SerializationDiagnosticsContext;
import com.azure.cosmos.implementation.ServiceUnavailableException;
import com.azure.cosmos.implementation.StoredProcedureResponse;
import com.azure.cosmos.implementation.TracerProvider;
import com.azure.cosmos.implementation.Warning;
import com.azure.cosmos.implementation.directconnectivity.StoreResponse;
import com.azure.cosmos.implementation.directconnectivity.StoreResponseDiagnostics;
Expand Down Expand Up @@ -82,6 +82,9 @@ public static CosmosDiagnostics createCosmosDiagnostics(DiagnosticsClientContext

@Warning(value = INTERNAL_USE_ONLY_WARNING)
public static Set<String> getRegionsContacted(CosmosDiagnostics cosmosDiagnostics) {
if (cosmosDiagnostics.clientSideRequestStatistics() == null) {
return Collections.<String>emptySet();
}
return cosmosDiagnostics.clientSideRequestStatistics().getContactedRegionNames();
}

Expand Down Expand Up @@ -188,8 +191,23 @@ public static <T> boolean noChanges(FeedResponse<T> page) {

@Warning(value = INTERNAL_USE_ONLY_WARNING)
public static <T> FeedResponse<T> createFeedResponse(List<T> results,
Map<String, String> headers) {
return ModelBridgeInternal.createFeedResponse(results, headers);
Map<String, String> headers, CosmosDiagnostics cosmosDiagnostics) {
FeedResponse<T> feedResponseWithDiagnostics = ModelBridgeInternal.createFeedResponse(results, headers);

if (cosmosDiagnostics == null) {
return feedResponseWithDiagnostics;
}

ClientSideRequestStatistics requestStatistics = cosmosDiagnostics.clientSideRequestStatistics();
if (requestStatistics != null) {
BridgeInternal.addClientSideDiagnosticsToFeed(feedResponseWithDiagnostics.getCosmosDiagnostics(),
Collections.singletonList(requestStatistics));
}
BridgeInternal.addClientSideDiagnosticsToFeed(feedResponseWithDiagnostics.getCosmosDiagnostics(),
cosmosDiagnostics.getFeedResponseDiagnostics()
.getClientSideRequestStatisticsList());

return feedResponseWithDiagnostics;
}

@Warning(value = INTERNAL_USE_ONLY_WARNING)
Expand Down Expand Up @@ -721,8 +739,8 @@ public static CosmosDatabase createCosmosDatabase(String id, CosmosClient client
}

@Warning(value = INTERNAL_USE_ONLY_WARNING)
public static TracerProvider getTracerProvider(CosmosAsyncClient client) {
return client.getTracerProvider();
public static DiagnosticsProvider getTracerProvider(CosmosAsyncClient client) {
return client.getDiagnosticsProvider();
}

@Warning(value = INTERNAL_USE_ONLY_WARNING)
Expand Down Expand Up @@ -772,8 +790,10 @@ public static void initializeAllAccessors() {
CosmosAsyncDatabase.initialize();
CosmosClientBuilder.initialize();
CosmosDiagnostics.initialize();
CosmosDiagnosticsContext.initialize();
CosmosException.initialize();
DirectConnectionConfig.initialize();
CosmosAsyncClient.initialize();
CosmosDiagnosticsThresholds.initialize();
}
}
Loading