Skip to content

Fix Couchbase stable DB span names#18993

Merged
trask merged 1 commit into
open-telemetry:mainfrom
trask:couchbase-stable-db-semconv
Jun 15, 2026
Merged

Fix Couchbase stable DB span names#18993
trask merged 1 commit into
open-telemetry:mainfrom
trask:couchbase-stable-db-semconv

Conversation

@trask

@trask trask commented Jun 14, 2026

Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings June 14, 2026 02:25
@trask trask requested a review from a team as a code owner June 14, 2026 02:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.operation access, add db.collection.name support, 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.

@trask trask marked this pull request as draft June 14, 2026 02:56
@trask trask force-pushed the couchbase-stable-db-semconv branch 2 times, most recently from 4383cb7 to 3534cba Compare June 15, 2026 00:48
@trask trask requested a review from Copilot June 15, 2026 01:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.

@trask trask force-pushed the couchbase-stable-db-semconv branch from 3534cba to 04b3a46 Compare June 15, 2026 04:10
@trask trask force-pushed the couchbase-stable-db-semconv branch from 04b3a46 to 415d48e Compare June 15, 2026 14:54
@trask trask requested a review from Copilot June 15, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@trask trask marked this pull request as ready for review June 15, 2026 16:27
@trask trask merged commit a170a10 into open-telemetry:main Jun 15, 2026
95 checks passed
@trask trask deleted the couchbase-stable-db-semconv branch June 15, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants