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

Merging back Tracer PR without conditional check on withContext() #12867

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
089307a
initial commit
simplynaveen20 Apr 8, 2020
175222e
changing sample
simplynaveen20 Apr 8, 2020
fe03e66
adding query api tracer support
simplynaveen20 Apr 13, 2020
9f9cce8
merging with master
simplynaveen20 Apr 14, 2020
e2e8e9e
reverting change for jaeger ui local testing
simplynaveen20 Apr 14, 2020
c2fc40f
adding tracers in trigger udf and sproc
simplynaveen20 Apr 15, 2020
eb82b61
Merge branch 'latest-master' into users/nakumars/tracercosmosdb
simplynaveen20 Apr 21, 2020
e614db5
adding test case and refactoring code
simplynaveen20 Apr 21, 2020
c4ae21b
Merge branch 'latest-master' into users/nakumars/tracercosmosdb
simplynaveen20 Apr 24, 2020
eabbec9
refactoring code with PR ready version
simplynaveen20 Apr 24, 2020
36dde95
ending span on doOnComplete
simplynaveen20 Apr 24, 2020
36743ca
resolving error
simplynaveen20 May 4, 2020
cff33ad
merging with master
simplynaveen20 May 4, 2020
8ca24ec
perf improvement
simplynaveen20 May 5, 2020
21034b5
resolving merge conflict
simplynaveen20 May 6, 2020
1f9f139
fixing build error
simplynaveen20 May 6, 2020
aab85a6
resolving merge conflict
simplynaveen20 May 11, 2020
d14a0bb
resolving merge conflict
simplynaveen20 May 11, 2020
8fbad2c
check non opentelementry jar non existence in starting of all api
simplynaveen20 May 11, 2020
6b09e5c
fixing checkstyle
simplynaveen20 May 11, 2020
81040b2
resolving comments
simplynaveen20 May 11, 2020
dbc74c8
Merge branch 'latest-master' into users/nakumars/tracercosmosdb
simplynaveen20 May 11, 2020
806cdf1
check style fix as per java 8
simplynaveen20 May 11, 2020
d061db5
adding azure-core-tracing-opentelemetry in test scope
simplynaveen20 May 11, 2020
32d9172
resolving conflict
simplynaveen20 May 11, 2020
0fc0cc9
build error fix
simplynaveen20 May 11, 2020
1290ae1
test failure fix
simplynaveen20 May 12, 2020
d2a8154
test fix
simplynaveen20 May 12, 2020
30c2f89
resolving comments
simplynaveen20 May 13, 2020
e7fa831
complie error fix
simplynaveen20 May 13, 2020
3aa851d
removing query text from tracer
simplynaveen20 May 15, 2020
0debac0
resolving merge conflict
simplynaveen20 May 15, 2020
8efa451
merge with master and removing subscriber context for perf gain
simplynaveen20 May 26, 2020
e7fe8bb
resolving merge conflict
simplynaveen20 May 26, 2020
3461604
resolving merge conflict after GA
simplynaveen20 Jun 11, 2020
0984a9c
code formating change and some comment resolution
simplynaveen20 Jun 11, 2020
b9c60a2
resolving comments
simplynaveen20 Jun 11, 2020
aaabc72
moving AZ_TRACING_NAMESPACE_KEY to context from span attribute
simplynaveen20 Jun 15, 2020
8024999
updating core opentelementry jar
simplynaveen20 Jun 15, 2020
2101851
Merge branch 'latest-master' into users/nakumars/tracercosmosdb
simplynaveen20 Jul 6, 2020
1f4c6ac
Tracer code without conditional check for withContext
simplynaveen20 Jul 7, 2020
1b0becb
Merge branch 'latest-master' into users/nakumars/tracercosmosdb
simplynaveen20 Jul 7, 2020
3548215
formating chage
simplynaveen20 Jul 7, 2020
eb398d9
formating chage
simplynaveen20 Jul 7, 2020
b168fd2
Merge branch 'latest-master' into users/nakumars/tracercosmosdb
simplynaveen20 Jul 9, 2020
9c1d31f
resolving comments
simplynaveen20 Jul 9, 2020
0703a28
build error fix
simplynaveen20 Jul 9, 2020
c5283fe
Merge branch 'latest-master' into users/nakumars/tracercosmosdb
simplynaveen20 Jul 9, 2020
deb6978
resolving comment
simplynaveen20 Jul 10, 2020
8af1cc9
resolving comments
simplynaveen20 Jul 10, 2020
798839c
resolving comment
simplynaveen20 Jul 10, 2020
21c5743
resolving comment
simplynaveen20 Jul 10, 2020
42e9789
removing extra method
simplynaveen20 Jul 10, 2020
be8d7eb
removing tets dependency
simplynaveen20 Jul 10, 2020
1f9725c
adding span attribute unit test
simplynaveen20 Jul 13, 2020
fc1296f
resolving comments
simplynaveen20 Jul 13, 2020
0a7aab0
resolving comments
simplynaveen20 Jul 14, 2020
8292a83
resolving merge conflic and comments
simplynaveen20 Jul 17, 2020
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
Prev Previous commit
Next Next commit
resolving merge conflict after GA
  • Loading branch information
simplynaveen20 committed Jun 11, 2020
commit 3461604e14d02caffdb2e6df5e9755702bf658c6
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ boolean isContentResponseOnWriteEnabled() {
* @return a {@link Mono} containing the cosmos database response with the created or existing database or
* an error.
*/
public Mono<CosmosAsyncDatabaseResponse> createDatabaseIfNotExists(CosmosDatabaseProperties databaseSettings) {
public Mono<CosmosDatabaseResponse> createDatabaseIfNotExists(CosmosDatabaseProperties databaseProperties) {
if(!getTracerProvider().isEnabled()) {
CosmosAsyncDatabase database = getDatabase(databaseSettings.getId());
CosmosAsyncDatabase database = getDatabase(databaseProperties.getId());
return createDatabaseIfNotExistsInternal(database.read(), database);
}

return withContext(context -> createDatabaseIfNotExistsInternal(getDatabase(databaseSettings.getId()),
return withContext(context -> createDatabaseIfNotExistsInternal(getDatabase(databaseProperties.getId()),
context));
}

Expand All @@ -221,7 +221,7 @@ public Mono<CosmosAsyncDatabaseResponse> createDatabaseIfNotExists(CosmosDatabas
* @return a {@link Mono} containing the cosmos database response with the created or existing database or
* an error.
*/
public Mono<CosmosAsyncDatabaseResponse> createDatabaseIfNotExists(String id) {
public Mono<CosmosDatabaseResponse> createDatabaseIfNotExists(String id) {
if(!getTracerProvider().isEnabled()) {
CosmosAsyncDatabase database = getDatabase(id);
return createDatabaseIfNotExistsInternal(database.read(), database);
Expand Down Expand Up @@ -277,7 +277,7 @@ public Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties data
options = new CosmosDatabaseRequestOptions();
}
Database wrappedDatabase = new Database();
wrappedDatabase.setId(databaseSettings.getId());
wrappedDatabase.setId(databaseProperties.getId());
if(!getTracerProvider().isEnabled()) {
return createDatabaseInternal(wrappedDatabase, options);
}
Expand Down Expand Up @@ -337,7 +337,7 @@ public Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties data
}
ModelBridgeInternal.setThroughputProperties(options, throughputProperties);
Database wrappedDatabase = new Database();
wrappedDatabase.setId(databaseSettings.getId());
wrappedDatabase.setId(databaseProperties.getId());
if (!getTracerProvider().isEnabled()) {
return createDatabaseInternal(wrappedDatabase, options);
}
Expand Down Expand Up @@ -444,7 +444,7 @@ public CosmosPagedFlux<CosmosDatabaseProperties> readAllDatabases() {
* @param options the feed options.
* @return a {@link CosmosPagedFlux} containing one or several feed response pages of read databases or an error.
*/
public CosmosPagedFlux<CosmosDatabaseProperties> queryDatabases(String query, FeedOptions options) {
public CosmosPagedFlux<CosmosDatabaseProperties> queryDatabases(String query, CosmosQueryRequestOptions options) {
samvaity marked this conversation as resolved.
Show resolved Hide resolved
return queryDatabasesInternal(new SqlQuerySpec(query), options);
}

Expand All @@ -459,7 +459,7 @@ public CosmosPagedFlux<CosmosDatabaseProperties> queryDatabases(String query, Fe
* @param options the feed options.
* @return a {@link CosmosPagedFlux} containing one or several feed response pages of read databases or an error.
*/
public CosmosPagedFlux<CosmosDatabaseProperties> queryDatabases(SqlQuerySpec querySpec, FeedOptions options) {
public CosmosPagedFlux<CosmosDatabaseProperties> queryDatabases(SqlQuerySpec querySpec, CosmosQueryRequestOptions options) {
return queryDatabasesInternal(querySpec, options);
}

Expand All @@ -485,7 +485,7 @@ TracerProvider getTracerProvider(){
return this.tracerProvider;
}

private CosmosPagedFlux<CosmosDatabaseProperties> queryDatabasesInternal(SqlQuerySpec querySpec, FeedOptions options){
private CosmosPagedFlux<CosmosDatabaseProperties> queryDatabasesInternal(SqlQuerySpec querySpec, CosmosQueryRequestOptions options){
return UtilBridgeInternal.createCosmosPagedFlux(pagedFluxOptions -> {
String spanName = "queryDatabases";
pagedFluxOptions.setTracerInformation(this.tracerProvider, spanName, this.serviceEndpoint, null);
Expand All @@ -498,16 +498,16 @@ private CosmosPagedFlux<CosmosDatabaseProperties> queryDatabasesInternal(SqlQuer
}


private Mono<CosmosAsyncDatabaseResponse> createDatabaseIfNotExistsInternal(CosmosAsyncDatabase database,
private Mono<CosmosDatabaseResponse> createDatabaseIfNotExistsInternal(CosmosAsyncDatabase database,
Context context) {
String spanName = "createDatabaseIfNotExists." + database.getId();
Context nestedContext = context.addData(TracerProvider.COSMOS_CALL_DEPTH, TracerProvider.COSMOS_CALL_DEPTH_VAL);
simplynaveen20 marked this conversation as resolved.
Show resolved Hide resolved
Mono<CosmosAsyncDatabaseResponse> responseMono = createDatabaseIfNotExistsInternal(database.readInternal(new CosmosDatabaseRequestOptions(), nestedContext), database);
Mono<CosmosDatabaseResponse> responseMono = createDatabaseIfNotExistsInternal(database.readInternal(new CosmosDatabaseRequestOptions(), nestedContext), database);
return tracerProvider.traceEnabledCosmosResponsePublisher(responseMono, context, spanName, database.getId(),
this.serviceEndpoint);
}

private Mono<CosmosAsyncDatabaseResponse> createDatabaseIfNotExistsInternal(Mono<CosmosAsyncDatabaseResponse> responseMono, CosmosAsyncDatabase database) {
private Mono<CosmosDatabaseResponse> createDatabaseIfNotExistsInternal(Mono<CosmosDatabaseResponse> responseMono, CosmosAsyncDatabase database) {
return responseMono.onErrorResume(exception -> {
final Throwable unwrappedException = Exceptions.unwrap(exception);
if (unwrappedException instanceof CosmosException) {
Expand All @@ -522,19 +522,17 @@ private Mono<CosmosAsyncDatabaseResponse> createDatabaseIfNotExistsInternal(Mono
}


private Mono<CosmosAsyncDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options,
private Mono<CosmosDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options,
Context context) {
String spanName = "createDatabase." + database.getId();
samvaity marked this conversation as resolved.
Show resolved Hide resolved
Mono<CosmosAsyncDatabaseResponse> responseMono = createDatabaseInternal(database, options);
Mono<CosmosDatabaseResponse> responseMono = createDatabaseInternal(database, options);
samvaity marked this conversation as resolved.
Show resolved Hide resolved
return tracerProvider.traceEnabledCosmosResponsePublisher(responseMono, context, spanName, database.getId(),
this.serviceEndpoint);
}

private Mono<CosmosAsyncDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options) {
return asyncDocumentClient.createDatabase(database,
ModelBridgeInternal.toRequestOptions(options))
.map(databaseResourceResponse -> ModelBridgeInternal.createCosmosAsyncDatabaseResponse(databaseResourceResponse,
this))
private Mono<CosmosDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options) {
return asyncDocumentClient.createDatabase(database, ModelBridgeInternal.toRequestOptions(options))
.map(databaseResourceResponse -> ModelBridgeInternal.createCosmosDatabaseResponse(databaseResourceResponse))
.single();
}
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.