diff --git a/gax-java/gax/clirr-ignored-differences.xml b/gax-java/gax/clirr-ignored-differences.xml
index b08615ef13..b58200572e 100644
--- a/gax-java/gax/clirr-ignored-differences.xml
+++ b/gax-java/gax/clirr-ignored-differences.xml
@@ -47,4 +47,10 @@
com/google/api/gax/rpc/StubSettings
* getServiceName()
+
+
+ 6011
+ com/google/api/gax/tracing/MetricsTracer
+ *
+
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java
index abbc9138dc..237e686896 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java
@@ -53,7 +53,7 @@
@BetaApi
@InternalApi
public class MetricsTracer implements ApiTracer {
- public static final String METHOD_NAME_ATTRIBUTE = "method_name";
+ public static final String METHOD_ATTRIBUTE = "method";
public static final String LANGUAGE_ATTRIBUTE = "language";
public static final String STATUS_ATTRIBUTE = "status";
public static final String DEFAULT_LANGUAGE = "Java";
@@ -67,7 +67,7 @@ public class MetricsTracer implements ApiTracer {
private final AtomicBoolean operationFinished;
public MetricsTracer(MethodName methodName, MetricsRecorder metricsRecorder) {
- this.attributes.put(METHOD_NAME_ATTRIBUTE, methodName.toString());
+ this.attributes.put(METHOD_ATTRIBUTE, methodName.toString());
this.attributes.put(LANGUAGE_ATTRIBUTE, DEFAULT_LANGUAGE);
this.metricsRecorder = metricsRecorder;
this.operationFinished = new AtomicBoolean();
diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerFactoryTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerFactoryTest.java
index d5459921e5..28a621f5f8 100644
--- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerFactoryTest.java
+++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerFactoryTest.java
@@ -74,7 +74,7 @@ void testNewTracer_hasCorrectNumberAttributes_hasDefaultAttributes() {
(MetricsTracer) metricsTracerFactory.newTracer(parent, spanName, OperationType.Unary);
Map attributes = metricsTracer.getAttributes();
Truth.assertThat(attributes.size()).isEqualTo(DEFAULT_ATTRIBUTES_COUNT);
- Truth.assertThat(attributes.get(MetricsTracer.METHOD_NAME_ATTRIBUTE))
+ Truth.assertThat(attributes.get(MetricsTracer.METHOD_ATTRIBUTE))
.isEqualTo("testService.testMethod");
Truth.assertThat(attributes.get(MetricsTracer.LANGUAGE_ATTRIBUTE))
.isEqualTo(MetricsTracer.DEFAULT_LANGUAGE);
diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java
index 5c0945a411..f409d27ec4 100644
--- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java
+++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java
@@ -65,11 +65,11 @@ void setUp() {
private ImmutableMap getAttributes(Code statusCode) {
return ImmutableMap.of(
- "status",
+ MetricsTracer.STATUS_ATTRIBUTE,
statusCode.toString(),
- "method_name",
+ MetricsTracer.METHOD_ATTRIBUTE,
DEFAULT_METHOD_NAME,
- "language",
+ MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
}
diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java
index a744a51432..55b07a851b 100644
--- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java
+++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java
@@ -310,7 +310,7 @@ void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedException {
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"Echo.Echo",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -333,7 +333,7 @@ void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedExceptio
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"google.showcase.v1beta1.Echo/Echo",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -363,7 +363,7 @@ void testGrpc_operationCancelled_recordsMetrics() throws Exception {
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"Echo.Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -391,7 +391,7 @@ void testHttpJson_operationCancelled_recordsMetrics() throws Exception {
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"google.showcase.v1beta1.Echo/Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -420,7 +420,7 @@ void testGrpc_operationFailed_recordsMetrics() throws InterruptedException {
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"Echo.Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -450,7 +450,7 @@ void testHttpJson_operationFailed_recordsMetrics() throws InterruptedException {
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"google.showcase.v1beta1.Echo/Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -513,7 +513,7 @@ void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Exception {
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"Echo.Echo",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -581,7 +581,7 @@ void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws Exceptio
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"google.showcase.v1beta1.Echo/Echo",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -611,7 +611,7 @@ void testGrpc_attemptPermanentFailure_recordsMetrics() throws InterruptedExcepti
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"Echo.Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -639,7 +639,7 @@ void testHttpJson_attemptPermanentFailure_recordsMetrics() throws InterruptedExc
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"google.showcase.v1beta1.Echo/Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -708,7 +708,7 @@ void testGrpc_multipleFailedAttempts_successfulOperation() throws Exception {
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"Echo.Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -778,7 +778,7 @@ void testHttpJson_multipleFailedAttempts_successfulOperation() throws Exception
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"google.showcase.v1beta1.Echo/Block",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE);
@@ -839,7 +839,7 @@ void recordsCustomAttributes() throws InterruptedException, IOException {
List actualMetricDataList = getMetricDataList(inMemoryMetricReader);
Map expectedAttributes =
ImmutableMap.of(
- MetricsTracer.METHOD_NAME_ATTRIBUTE,
+ MetricsTracer.METHOD_ATTRIBUTE,
"Echo.Echo",
MetricsTracer.LANGUAGE_ATTRIBUTE,
MetricsTracer.DEFAULT_LANGUAGE,