Skip to content

Remove network.type from stable Cassandra db spans#18920

Merged
laurit merged 3 commits into
open-telemetry:mainfrom
trask:cassandra-stable-db-network-type
Jun 8, 2026
Merged

Remove network.type from stable Cassandra db spans#18920
laurit merged 3 commits into
open-telemetry:mainfrom
trask:cassandra-stable-db-network-type

Conversation

@trask

@trask trask commented Jun 6, 2026

Copy link
Copy Markdown
Member

No description provided.

@trask trask changed the title Remove network.type from stable Cassandra db spans Remove network.type from stable Cassandra db spans Jun 6, 2026
@trask
trask requested a review from Copilot June 6, 2026 20:38

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

This PR updates database span semantic-convention behavior so that network.type is not emitted when stable database semantic conventions are enabled, aligning Cassandra instrumentation tests with the expected stable DB span attribute set.

Changes:

  • Update Cassandra 3.0/4.0/4.4 tests to expect network.type to be absent (null) when stable database semconv is enabled.
  • Adjust SqlClientAttributesExtractor to only capture network protocol attributes (including network.type) when old database semconv is enabled.

Reviewed changes

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

File Description
instrumentation/cassandra/cassandra-common-4.0/testing/src/main/java/io/opentelemetry/cassandra/common/v4_0/AbstractCassandraTest.java Updates span assertions so network.type is expected only under old DB semconv.
instrumentation/cassandra/cassandra-4.4/testing/src/main/java/io/opentelemetry/testing/cassandra/v4_4/AbstractCassandra44Test.java Updates reactive span assertions to match removal of network.type under stable DB semconv.
instrumentation/cassandra/cassandra-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraClientTest.java Updates javaagent test assertions to expect network.type == null under stable DB semconv.
instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractor.java Gates capture of protocol-level network attributes on emitOldDatabaseSemconv(), preventing network.type on stable DB spans.

The stable semconv Cassandra span no longer emits network.type, but the
Camel 2.20 Cassandra test still required that attribute in its exact
stable-mode assertion. Remove the stale assertion and unused import so
testStableSemconv matches the emitted stable attributes.

Validation:
.\gradlew.bat :instrumentation:camel-2.20:javaagent:testStableSemconv
.\gradlew.bat :instrumentation:camel-2.20:javaagent:testStableSemconv -PtestLatestDeps=true
@trask
trask force-pushed the cassandra-stable-db-network-type branch from 530cfae to 1095eec Compare June 6, 2026 22:00
@trask
trask marked this pull request as ready for review June 6, 2026 23:00
@trask
trask requested a review from a team as a code owner June 6, 2026 23:00
@laurit
laurit merged commit 7fd551e into open-telemetry:main Jun 8, 2026
181 of 184 checks passed
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