Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JVMCBC-1314: Pathfind OpenTelemetry integration with CNG
This adds the GRPC automatic instrumentation from package opentelemetry-grpc-1.6, which will automatically create spans such as `couchbase.kv.v1.KvService/Upsert` underneath dispatch_to_server. Streaming services aren't touched, as they don't support OpenTelemetry right now anyway. (JVMCBC-1321) Change-Id: I9ab70dadb94fab678a8f616aa32f6429aa911fbd Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/192537 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: David Nault <david.nault@couchbase.com> Reviewed-by: Michael Reiche <michael.reiche@couchbase.com>
- Loading branch information
1 parent
987c3d5
commit 37a82f5
Showing
9 changed files
with
134 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
core-io/src/main/java/com/couchbase/client/core/protostellar/GrpcAwareRequestTracer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2023 Couchbase, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.couchbase.client.core.protostellar; | ||
|
||
import com.couchbase.client.core.annotation.Stability; | ||
import com.couchbase.client.core.cnc.RequestSpan; | ||
import com.couchbase.client.core.deps.io.grpc.ManagedChannelBuilder; | ||
|
||
@Stability.Internal | ||
public interface GrpcAwareRequestTracer { | ||
|
||
/** | ||
* Setup GRPC instrumentation on a given GRPC channel. | ||
*/ | ||
void registerGrpc(ManagedChannelBuilder<?> builder); | ||
|
||
/** | ||
* Puts `span` into ThreadLocalStorage, ready to be picked up by libraries that rely on that mechanism and can't be passed the span explicitly. | ||
* <p> | ||
* We require this as asynchronous mechanisms such as reactive and CompletableFuture do not play well with ThreadLocalStorage. | ||
*/ | ||
AutoCloseable activateSpan(RequestSpan span); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters