Skip to content

Commit

Permalink
SpanBuilder.withTag(name, "") should behave like span.setTag(name, ""…
Browse files Browse the repository at this point in the history
…) and map empty strings to null, ie. remove the tag (#5155)
  • Loading branch information
mcculls authored and joeyzhao2018 committed May 4, 2023
1 parent 76b820e commit 0d571b0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ public CoreSpanBuilder withTag(final String tag, final Number number) {

@Override
public CoreSpanBuilder withTag(final String tag, final String string) {
return withTag(tag, (Object) string);
return withTag(tag, (Object) (string == null || string.isEmpty() ? null : string));
}

@Override
Expand Down

0 comments on commit 0d571b0

Please sign in to comment.