Skip to content

Commit

Permalink
Don't extract deprecated cassandra keyspace attribute (#5041)
Browse files Browse the repository at this point in the history
  • Loading branch information
iNikem authored Jan 7, 2022
1 parent 25550e0 commit daeda5d
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 39 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public final class CassandraSingletons {
GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, spanName)
.addAttributesExtractor(attributesExtractor)
.addAttributesExtractor(new CassandraNetAttributesExtractor())
.addAttributesExtractor(new CassandraKeyspaceExtractor())
.newInstrumenter(SpanKindExtractor.alwaysClient());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class CassandraClientTest extends AgentInstrumentationSpecification {
"$SemanticAttributes.DB_NAME" keyspace
"$SemanticAttributes.DB_STATEMENT" statement
"$SemanticAttributes.DB_OPERATION" operation
"$SemanticAttributes.DB_CASSANDRA_KEYSPACE" keyspace
"$SemanticAttributes.DB_CASSANDRA_TABLE" table
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package io.opentelemetry.javaagent.instrumentation.cassandra.v4_0;

import com.datastax.oss.driver.api.core.CqlIdentifier;
import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
import com.datastax.oss.driver.api.core.config.DriverExecutionProfile;
import com.datastax.oss.driver.api.core.cql.ExecutionInfo;
Expand All @@ -20,12 +19,7 @@ final class CassandraAttributesExtractor
implements AttributesExtractor<CassandraRequest, ExecutionInfo> {

@Override
public void onStart(AttributesBuilder attributes, CassandraRequest request) {
set(
attributes,
SemanticAttributes.DB_CASSANDRA_KEYSPACE,
request.getSession().getKeyspace().map(CqlIdentifier::toString).orElse(null));
}
public void onStart(AttributesBuilder attributes, CassandraRequest request) {}

@Override
public void onEnd(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class CassandraClientTest extends AgentInstrumentationSpecification {
"$SemanticAttributes.DB_CASSANDRA_IDEMPOTENCE" Boolean
"$SemanticAttributes.DB_CASSANDRA_PAGE_SIZE" 5000
"$SemanticAttributes.DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT" 0
"$SemanticAttributes.DB_CASSANDRA_KEYSPACE" keyspace
// the SqlStatementSanitizer can't handle CREATE statements yet
"$SemanticAttributes.DB_CASSANDRA_TABLE" table
}
Expand Down

0 comments on commit daeda5d

Please sign in to comment.