@Override public BraveSpan setTag(String key, boolean value) { if (finishCalled) return this; if (Tags.ERROR.getKey().equals(key) && !value) return this; return setTag(key, Boolean.toString(value)); }
/** * <em>Note:</em>If the key is {@linkplain Tags#SAMPLING_PRIORITY} and the value is zero, the * current span will be abandoned and future references to the {@link #context()} will be * unsampled. This does not affect the active span, nor does it affect any equivalent instances of * this object. This is a best efforts means to handle late sampling decisions. */ @Override public BraveSpan setTag(String key, Number value) { if (finishCalled) return this; if (trySetPeer(key, value)) return this; // handle late sampling decision if (Tags.SAMPLING_PRIORITY.getKey().equals(key) && value.intValue() == 0) { delegate.abandon(); // convert the span to no-op delegate = tracer.toSpan(delegate.context().toBuilder().sampled(false).build()); } return setTag(key, value.toString()); }
result.remotePort = remotePort; for (Map.Entry<String, String> tag : tags.entrySet()) { result.setTag(tag.getKey(), tag.getValue());