Add Couchbase 3.x stable db semconv support#18926
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds stable database semantic conventions support for Couchbase Java Client 3.x javaagent instrumentation by wrapping Couchbase’s upstream OpenTelemetry request tracer and translating deprecated DB semconv attribute keys to their stable equivalents.
Changes:
- Introduces
CouchbaseRequestTracerwrappers for Couchbase 3.1 / 3.1.6 / 3.2 / 3.4 to translate old DB semconv keys to stable DB semconv keys (and optionally pass through Couchbase-specific attributes). - Strengthens Couchbase 3.x javaagent tests to assert stable DB semconv behavior, including an additional “stable semconv + experimental Couchbase attributes” test task.
- Adds config documentation/metadata for Couchbase 3.x and extends CI instrumentation task coverage to run the new test tasks.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/db/SemconvStabilityUtil.java | Extends old→stable DB attribute-key mapping used by tests to include Couchbase collection key. |
| instrumentation/couchbase/README.md | Updates Couchbase instrumentation config documentation. |
| instrumentation/couchbase/couchbase-3.4/metadata.yaml | Adds documented configuration for Couchbase 3.4 instrumentation. |
| instrumentation/couchbase/couchbase-3.4/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_4/CouchbaseClient34Test.java | Adds stable DB semconv attribute assertions for Couchbase 3.4. |
| instrumentation/couchbase/couchbase-3.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_4/CouchbaseRequestTracer.java | New wrapper tracer that translates old DB semconv attributes to stable DB semconv. |
| instrumentation/couchbase/couchbase-3.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_4/CouchbaseEnvironmentInstrumentation.java | Switches environment instrumentation to install the new wrapper tracer. |
| instrumentation/couchbase/couchbase-3.4/javaagent/build.gradle.kts | Adds an additional stable-semconv test task enabling Couchbase experimental attributes and wires it into check. |
| instrumentation/couchbase/couchbase-3.2/metadata.yaml | Adds documented configuration for Couchbase 3.2 instrumentation. |
| instrumentation/couchbase/couchbase-3.2/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_2/CouchbaseClient32Test.java | Adds stable DB semconv attribute assertions for Couchbase 3.2. |
| instrumentation/couchbase/couchbase-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_2/CouchbaseRequestTracer.java | New wrapper tracer that translates old DB semconv attributes to stable DB semconv. |
| instrumentation/couchbase/couchbase-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_2/CouchbaseEnvironmentInstrumentation.java | Switches environment instrumentation to install the new wrapper tracer. |
| instrumentation/couchbase/couchbase-3.2/javaagent/build.gradle.kts | Adds an additional stable-semconv test task enabling Couchbase experimental attributes and wires it into check. |
| instrumentation/couchbase/couchbase-3.1/metadata.yaml | Adds documented configuration for Couchbase 3.1 instrumentation. |
| instrumentation/couchbase/couchbase-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseClient31Test.java | Adds stable DB semconv attribute assertions for Couchbase 3.1. |
| instrumentation/couchbase/couchbase-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseRequestTracer.java | New wrapper tracer that translates old DB semconv attributes to stable DB semconv (includes muzzle handling notes for 3.1.0–3.1.2). |
| instrumentation/couchbase/couchbase-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseEnvironmentInstrumentation.java | Switches environment instrumentation to install the new wrapper tracer. |
| instrumentation/couchbase/couchbase-3.1/javaagent/build.gradle.kts | Adds muzzle compileOnly dep for @NoMuzzle and adds the new stable-semconv experimental test task to check. |
| instrumentation/couchbase/couchbase-3.1.6/metadata.yaml | Adds documented configuration for Couchbase 3.1.6 instrumentation. |
| instrumentation/couchbase/couchbase-3.1.6/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1_6/CouchbaseClient316Test.java | Adds stable DB semconv attribute assertions for Couchbase 3.1.6. |
| instrumentation/couchbase/couchbase-3.1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1_6/CouchbaseRequestTracer.java | New wrapper tracer that translates old DB semconv attributes to stable DB semconv. |
| instrumentation/couchbase/couchbase-3.1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1_6/CouchbaseEnvironmentInstrumentation.java | Switches environment instrumentation to install the new wrapper tracer. |
| instrumentation/couchbase/couchbase-3.1.6/javaagent/build.gradle.kts | Adds an additional stable-semconv test task enabling Couchbase experimental attributes and wires it into check. |
| .github/scripts/instrumentations.sh | Adds Couchbase 3.x stable semconv test tasks to the CI instrumentation task list. |
trask
marked this pull request as ready for review
June 8, 2026 03:54
jaydeluca
approved these changes
Jun 9, 2026
laurit
reviewed
Jun 9, 2026
| @@ -2,4 +2,4 @@ | |||
|
|
|||
| | System property | Type | Default | Description | | |||
| |---------------------------------------------------------------|---------|---------|-------------------------------------------------------------------------| | |||
trask
added a commit
to trask/opentelemetry-java-instrumentation
that referenced
this pull request
Jun 9, 2026
This was referenced Jul 10, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Missed this before because it relies on the upstream library instrumentation.