@Immutable
public abstract class SpanDataBuilder
extends java.lang.Object
implements io.opentelemetry.sdk.trace.data.SpanData
SpanData
implementation with a builder that can be used to modify parts of a SpanData
.
String clientType = ClientConfig.parseUserAgent(
data.getAttributes().get(SemanticAttributes.HTTP_USER_AGENT).getStringValue());
Attributes newAttributes = Attributes.newBuilder(data.getAttributes())
.setAttribute("client_type", clientType)
.build();
data = io.opentelemetry.sdk.extensions.incubator.trace.data.SpanData.newBuilder(data)
.setAttributes(newAttributes)
.build();
exporter.export(data);
Constructor and Description |
---|
SpanDataBuilder() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static io.opentelemetry.sdk.extensions.incubator.trace.data.SpanDataBuilder.Builder |
newBuilder(io.opentelemetry.sdk.trace.data.SpanData spanData)
Returns a
SpanDataBuilder.Builder populated with the information in the provided SpanData . |
io.opentelemetry.sdk.extensions.incubator.trace.data.SpanDataBuilder.Builder |
toBuilder() |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttributes, getEndEpochNanos, getEvents, getHasEnded, getHasRemoteParent, getInstrumentationLibraryInfo, getKind, getLinks, getName, getParentSpanId, getResource, getSpanId, getStartEpochNanos, getStatus, getTotalAttributeCount, getTotalRecordedEvents, getTotalRecordedLinks, getTraceId, getTraceState, isSampled
public static io.opentelemetry.sdk.extensions.incubator.trace.data.SpanDataBuilder.Builder newBuilder(io.opentelemetry.sdk.trace.data.SpanData spanData)
SpanDataBuilder.Builder
populated with the information in the provided SpanData
.public final io.opentelemetry.sdk.extensions.incubator.trace.data.SpanDataBuilder.Builder toBuilder()
public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object