Fix Couchbase stable DB span names#18993
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Couchbase DB method-call span naming to align with stable database semantic conventions by incorporating the bucket namespace in stable span names, while preserving the legacy operation-only names under old semconv. This builds on the shared DB client semconv API changes from #18989 by refining span-name/attribute behavior and test expectations.
Changes:
- Adjust Couchbase method-call span names so stable semconv includes the bucket name/namespace, while old semconv keeps existing operation-only names.
- Update DB client incubator APIs to better support migration: add old
db.operationaccess, adddb.collection.namesupport, and make stable span-name extraction prefer collection name over namespace. - Update/extend tests to validate the new stable-vs-old behavior (including collection-name preference).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| instrumentation/couchbase/couchbase-common/testing/src/main/java/io/opentelemetry/instrumentation/couchbase/springdata/AbstractCouchbaseSpringTemplateTest.java | Updates expected Couchbase span names to include bucket name when stable DB semconv is enabled. |
| instrumentation/couchbase/couchbase-common/testing/src/main/java/io/opentelemetry/instrumentation/couchbase/springdata/AbstractCouchbaseSpringRepositoryTest.java | Updates repository tests’ expected span names for stable vs old semconv behavior. |
| instrumentation/couchbase/couchbase-common/testing/src/main/java/io/opentelemetry/instrumentation/couchbase/AbstractCouchbaseClientTest.java | Updates client tests’ expected span names to include bucket name under stable semconv. |
| instrumentation/couchbase/couchbase-common/testing/src/main/java/io/opentelemetry/instrumentation/couchbase/AbstractCouchbaseAsyncClientTest.java | Updates async client tests’ expected span names for stable semconv naming. |
| instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseSpanNameExtractor.java | Preserves legacy method-call naming only for old semconv; delegates to DB span-name extraction for stable semconv. |
| instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientSpanNameExtractorTest.java | Updates stubbing/expectations for stable vs old semconv and adds test that collection name is preferred over namespace. |
| instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java | Extends test getter and assertions to cover db.collection.name and legacy db.operation. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesGetter.java | Updates API docs and adds a default getDbCollectionName method for SQL getters. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientSpanNameExtractor.java | Updates stable span-name fallback logic to prefer db.collection.name over namespace and uses legacy db.operation for old semconv. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesGetter.java | Adds legacy getDbOperation() and introduces getDbCollectionName() extension point. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractor.java | Emits db.collection.name for stable semconv and uses legacy db.operation for old semconv. |
4383cb7 to
3534cba
Compare
3534cba to
04b3a46
Compare
04b3a46 to
415d48e
Compare
laurit
approved these changes
Jun 15, 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.
Built on top of #18989. Updates Couchbase method-call span names so stable database semconv includes the bucket namespace while old semconv keeps the existing operation-only method-call names.