Skip to content

Commit

Permalink
HBASE-26520 Remove use of db.hbase.namespance tracing attribute (#4015
Browse files Browse the repository at this point in the history
)

The HBase-specific attribute `db.hbase.namespace` has been deprecated in favor of the generic
`db.name`. See also open-telemetry/opentelemetry-specification#1760

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org>
  • Loading branch information
ndimiduk committed Jan 19, 2022
1 parent 8fbc9a2 commit c2b4ccd
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.hadoop.hbase.client.trace;

import static org.apache.hadoop.hbase.trace.HBaseSemanticAttributes.DB_NAME;
import static org.apache.hadoop.hbase.trace.HBaseSemanticAttributes.NAMESPACE_KEY;
import static org.apache.hadoop.hbase.trace.HBaseSemanticAttributes.TABLE_KEY;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.trace.Span;
Expand Down Expand Up @@ -92,7 +91,6 @@ static void populateTableNameAttributes(
final Map<AttributeKey<?>, Object> attributes,
final TableName tableName
) {
attributes.put(NAMESPACE_KEY, tableName.getNamespaceAsString());
attributes.put(DB_NAME, tableName.getNamespaceAsString());
attributes.put(TABLE_KEY, tableName.getNameAsString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected void assertTrace(String className, String methodName, ServerName serve

if (tableName != null) {
assertEquals(tableName.getNamespaceAsString(),
data.getAttributes().get(HBaseSemanticAttributes.NAMESPACE_KEY));
data.getAttributes().get(HBaseSemanticAttributes.DB_NAME));
assertEquals(tableName.getNameAsString(),
data.getAttributes().get(HBaseSemanticAttributes.TABLE_KEY));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public static Matcher<SpanData> buildConnectionAttributesMatcher(ConnectionImple
public static Matcher<SpanData> buildTableAttributesMatcher(TableName tableName) {
return hasAttributes(allOf(
containsEntry("db.name", tableName.getNamespaceAsString()),
containsEntry("db.hbase.namespace", tableName.getNamespaceAsString()),
containsEntry("db.hbase.table", tableName.getNameAsString())));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public final class HBaseSemanticAttributes {
SemanticAttributes.DB_CONNECTION_STRING;
public static final AttributeKey<String> DB_USER = SemanticAttributes.DB_USER;
public static final AttributeKey<String> DB_NAME = SemanticAttributes.DB_NAME;
public static final AttributeKey<String> NAMESPACE_KEY = SemanticAttributes.DB_HBASE_NAMESPACE;
public static final AttributeKey<String> DB_OPERATION = SemanticAttributes.DB_OPERATION;
public static final AttributeKey<String> TABLE_KEY = AttributeKey.stringKey("db.hbase.table");
public static final AttributeKey<List<String>> REGION_NAMES_KEY =
Expand Down

0 comments on commit c2b4ccd

Please sign in to comment.