From 2f9e7337266bab87c2dc2b272af0eebbc1838708 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Tue, 30 Nov 2021 08:28:05 -0800 Subject: [PATCH] HBASE-26520 Remove use of `db.hbase.namespance` tracing attribute The HBase-specific attribute `db.hbase.namespace` has been deprecated in favor of the generic `db.name`. See also https://github.com/open-telemetry/opentelemetry-specification/issues/1760 --- .../org/apache/hadoop/hbase/client/trace/TableSpanBuilder.java | 2 -- .../hadoop/hbase/client/trace/hamcrest/TraceTestUtil.java | 1 - .../org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java | 1 - 3 files changed, 4 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/trace/TableSpanBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/trace/TableSpanBuilder.java index 4f328602435f..a3b52c788897 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/trace/TableSpanBuilder.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/trace/TableSpanBuilder.java @@ -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; @@ -47,7 +46,6 @@ public B self() { public B setTableName(final TableName tableName) { this.tableName = tableName; - attributes.put(NAMESPACE_KEY, tableName.getNamespaceAsString()); attributes.put(DB_NAME, tableName.getNamespaceAsString()); attributes.put(TABLE_KEY, tableName.getNameAsString()); return self(); diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/TraceTestUtil.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/TraceTestUtil.java index 3a8fc30af933..98f1ffd9c913 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/TraceTestUtil.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/TraceTestUtil.java @@ -47,7 +47,6 @@ public static Matcher buildConnectionAttributesMatcher(AsyncConnection public static Matcher buildTableAttributesMatcher(TableName tableName) { return hasAttributes(allOf( containsEntry("db.name", tableName.getNamespaceAsString()), - containsEntry("db.hbase.namespace", tableName.getNamespaceAsString()), containsEntry("db.hbase.table", tableName.getNameAsString()))); } } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java index cdcf65c36755..1a74fdcd65a2 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java @@ -34,7 +34,6 @@ public final class HBaseSemanticAttributes { SemanticAttributes.DB_CONNECTION_STRING; public static final AttributeKey DB_USER = SemanticAttributes.DB_USER; public static final AttributeKey DB_NAME = SemanticAttributes.DB_NAME; - public static final AttributeKey NAMESPACE_KEY = SemanticAttributes.DB_HBASE_NAMESPACE; public static final AttributeKey DB_OPERATION = SemanticAttributes.DB_OPERATION; public static final AttributeKey TABLE_KEY = AttributeKey.stringKey("db.hbase.table"); /**