Skip to content

Commit bd31e37

Browse files
update javadoc for Attribute and AttributeReturnValue
1 parent aaf4b3a commit bd31e37

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

instrumentation-annotations-incubator/src/main/java/io/opentelemetry/instrumentation/annotations/incubator/Attribute.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* This annotation marks that a parameter of a method or constructor annotated with {@link Timed} or
1515
* {@link Counted} should be added as an attribute to the metric.
1616
*
17+
* <p>By default, the `{@link Object#toString()}` will be called on the parameter value to convert
18+
* it to a String.
19+
*
1720
* <p>Application developers can use this annotation to signal OpenTelemetry auto-instrumentation
1821
* that the attribute should be captured.
1922
*
@@ -33,8 +36,7 @@
3336
*
3437
* <p>If not specified and the code is compiled using the `{@code -parameters}` argument to
3538
* `javac`, the parameter name will be used instead. If the parameter name is not available, e.g.,
36-
* because the code was not compiled with that flag, the attribute will be ignored. `{@link
37-
* Object#toString()}` may be called on the attribute value to convert it to a String.
39+
* because the code was not compiled with that flag, the attribute will be ignored.
3840
*/
3941
String value() default "";
4042
}

instrumentation-annotations-incubator/src/main/java/io/opentelemetry/instrumentation/annotations/incubator/AttributeReturnValue.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* This annotation allows for adding the method return value as an attribute to metrics recorded
1515
* using the {@link Timed} and {@link Counted} annotations.
1616
*
17+
* <p>By default, the {@link Object#toString()} will be called on the return value to convert it to
18+
* a String.
19+
*
1720
* <p>Application developers can use this annotation to signal OpenTelemetry auto-instrumentation
1821
* that the attribute should be captured.
1922
*
@@ -31,8 +34,7 @@
3134
/**
3235
* Attribute name for the return value.
3336
*
34-
* <p>The name of the attribute for the return value of the method call. {@link Object#toString()}
35-
* may be called on the return value to convert it to a String.
37+
* <p>The name of the attribute for the return value of the method call.
3638
*/
3739
String value();
3840
}

0 commit comments

Comments
 (0)