Skip to content

Commit

Permalink
group functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin Zhao committed Nov 16, 2024
1 parent 0d8e02c commit 70de66c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
25 changes: 12 additions & 13 deletions api/all/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ public interface SpanBuilder {
*/
SpanBuilder setAttribute(String key, double value);

/**
* Sets an attribute to the {@code Span}. If the {@code Span} previously contained a mapping for
* the key, the old value is replaced by the specified value.
*
* @param key the key for this attribute.
* @param value the value for this attribute.
* @return this.
*/
default SpanBuilder setAttribute(AttributeKey<Long> key, int value) {
return setAttribute(key, (long) value);
}

/**
* Sets an attribute to the newly created {@code Span}. If {@code SpanBuilder} previously
* contained a mapping for the key, the old value is replaced by the specified value.
Expand Down Expand Up @@ -339,17 +351,4 @@ default SpanBuilder setStartTimestamp(Instant startTimestamp) {
* @return the newly created {@code Span}.
*/
Span startSpan();


/**
* Sets an attribute to the {@code Span}. If the {@code Span} previously contained a mapping for
* the key, the old value is replaced by the specified value.
*
* @param key the key for this attribute.
* @param value the value for this attribute.
* @return this.
*/
default SpanBuilder setAttribute(AttributeKey<Long> key, int value) {
return setAttribute(key, (long) value);
}
}
4 changes: 3 additions & 1 deletion docs/apidiffs/current_vs_latest/opentelemetry-api.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Comparing source compatibility of opentelemetry-api-1.45.0-SNAPSHOT.jar against opentelemetry-api-1.44.1.jar
No changes.
*** MODIFIED INTERFACE: PUBLIC ABSTRACT io.opentelemetry.api.trace.SpanBuilder (not serializable)
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.api.trace.SpanBuilder setAttribute(io.opentelemetry.api.common.AttributeKey<java.lang.Long>, int)

0 comments on commit 70de66c

Please sign in to comment.