From fbbc55a5e69e7ca0fb32d6202cfcf8f771514986 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 da1ba38af423..0d89c582bbb2 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; @@ -81,7 +80,6 @@ static void populateTableNameAttributes( final Map, Object> attributes, final TableName tableName ) { - attributes.put(NAMESPACE_KEY, tableName.getNamespaceAsString()); attributes.put(DB_NAME, tableName.getNamespaceAsString()); attributes.put(TABLE_KEY, tableName.getNameAsString()); } 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 59c372f8a782..fd6ab852e063 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"); public static final AttributeKey> REGION_NAMES_KEY =