Skip to content

Commit f92cd3e

Browse files
rename AttributeForReturnValue to AttributeReturnValue
1 parent d5a7365 commit f92cd3e

File tree

4 files changed

+9
-10
lines changed
  • instrumentation-annotations-incubator/src/main/java/io/opentelemetry/instrumentation/annotations/incubator
  • instrumentation/opentelemetry-instrumentation-annotations/opentelemetry-instrumentation-annotations-incubator/javaagent/src

4 files changed

+9
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
@Target(ElementType.METHOD)
3131
@Retention(RetentionPolicy.RUNTIME)
32-
public @interface AttributeForReturnValue {
32+
public @interface AttributeReturnValue {
3333

3434
/**
3535
* Attribute name for the return value.

instrumentation/opentelemetry-instrumentation-annotations/opentelemetry-instrumentation-annotations-incubator/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/instrumentationannotations/incubator/MetricsAnnotationHelper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.opentelemetry.javaagent.instrumentation.instrumentationannotations.incubator;
77

88
import application.io.opentelemetry.instrumentation.annotations.incubator.Attribute;
9-
import application.io.opentelemetry.instrumentation.annotations.incubator.AttributeForReturnValue;
9+
import application.io.opentelemetry.instrumentation.annotations.incubator.AttributeReturnValue;
1010
import application.io.opentelemetry.instrumentation.annotations.incubator.StaticAttribute;
1111
import io.opentelemetry.api.GlobalOpenTelemetry;
1212
import io.opentelemetry.api.common.Attributes;
@@ -67,8 +67,7 @@ static class MetricAttributeHelper {
6767

6868
MetricAttributeHelper(Method method) {
6969
bindParameters = MethodBinder.bindParameters(method, PARAMETER_ATTRIBUTE_NAMES_EXTRACTOR);
70-
AttributeForReturnValue returnValueAttribute =
71-
method.getAnnotation(AttributeForReturnValue.class);
70+
AttributeReturnValue returnValueAttribute = method.getAnnotation(AttributeReturnValue.class);
7271
bindReturn =
7372
returnValueAttribute != null
7473
? MethodBinder.bindReturnValue(method, returnValueAttribute.value())

instrumentation/opentelemetry-instrumentation-annotations/opentelemetry-instrumentation-annotations-incubator/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/instrumentationannotations/incubator/counted/CountedExample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.opentelemetry.javaagent.instrumentation.instrumentationannotations.incubator.counted;
77

88
import io.opentelemetry.instrumentation.annotations.incubator.Attribute;
9-
import io.opentelemetry.instrumentation.annotations.incubator.AttributeForReturnValue;
9+
import io.opentelemetry.instrumentation.annotations.incubator.AttributeReturnValue;
1010
import io.opentelemetry.instrumentation.annotations.incubator.Counted;
1111
import io.opentelemetry.instrumentation.annotations.incubator.StaticAttribute;
1212
import java.util.concurrent.CompletableFuture;
@@ -40,7 +40,7 @@ public void exampleWithAttributes(
4040
@Attribute("custom_attr2") ToStringObject toStringObject) {}
4141

4242
@Counted(value = "example.with.return.count")
43-
@AttributeForReturnValue("returnValue")
43+
@AttributeReturnValue("returnValue")
4444
public ToStringObject exampleWithReturnValueAttribute() {
4545
return new ToStringObject();
4646
}
@@ -54,7 +54,7 @@ public void exampleWithException() {
5454
public void exampleIgnore() {}
5555

5656
@Counted(value = "example.completable.future.count")
57-
@AttributeForReturnValue("returnValue")
57+
@AttributeReturnValue("returnValue")
5858
public CompletableFuture<String> completableFuture(CompletableFuture<String> future) {
5959
return future;
6060
}

instrumentation/opentelemetry-instrumentation-annotations/opentelemetry-instrumentation-annotations-incubator/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/instrumentationannotations/incubator/timed/TimedExample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.opentelemetry.javaagent.instrumentation.instrumentationannotations.incubator.timed;
77

88
import io.opentelemetry.instrumentation.annotations.incubator.Attribute;
9-
import io.opentelemetry.instrumentation.annotations.incubator.AttributeForReturnValue;
9+
import io.opentelemetry.instrumentation.annotations.incubator.AttributeReturnValue;
1010
import io.opentelemetry.instrumentation.annotations.incubator.StaticAttribute;
1111
import io.opentelemetry.instrumentation.annotations.incubator.Timed;
1212
import java.util.concurrent.CompletableFuture;
@@ -42,13 +42,13 @@ public void exampleWithException() {
4242
}
4343

4444
@Timed(value = "example.with.return.duration")
45-
@AttributeForReturnValue("returnValue")
45+
@AttributeReturnValue("returnValue")
4646
public ToStringObject exampleWithReturnValueAttribute() {
4747
return new ToStringObject();
4848
}
4949

5050
@Timed(value = "example.completable.future.duration")
51-
@AttributeForReturnValue("returnValue")
51+
@AttributeReturnValue("returnValue")
5252
public CompletableFuture<String> completableFuture(CompletableFuture<String> future) {
5353
return future;
5454
}

0 commit comments

Comments
 (0)