public abstract static class TestSpanData.Builder extends Object
Builder
class for TestSpanData
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
TestSpanData |
build()
Create a new SpanData instance from the data in this.
|
abstract TestSpanData.Builder |
setAttributes(io.opentelemetry.common.ReadableAttributes attributes)
Set the attributes that are associated with this span, as a Map of String keys to
AttributeValue instances.
|
abstract TestSpanData.Builder |
setEndEpochNanos(long epochNanos)
Set the end timestamp of the span.
|
abstract TestSpanData.Builder |
setEvents(List<SpanData.Event> events)
Set timed events that are associated with this span.
|
abstract TestSpanData.Builder |
setHasEnded(boolean hasEnded)
Sets to true if the span has been ended.
|
abstract TestSpanData.Builder |
setHasRemoteParent(boolean hasRemoteParent)
Sets to true if the span has a parent on a different process.
|
abstract TestSpanData.Builder |
setInstrumentationLibraryInfo(InstrumentationLibraryInfo instrumentationLibraryInfo)
Sets the instrumentation library of the tracer which created this span.
|
abstract TestSpanData.Builder |
setKind(io.opentelemetry.trace.Span.Kind kind)
Set the kind of span.
|
abstract TestSpanData.Builder |
setLinks(List<SpanData.Link> links)
Set the links associated with this span.
|
abstract TestSpanData.Builder |
setName(String name)
Set the name of the span.
|
abstract TestSpanData.Builder |
setParentSpanId(io.opentelemetry.trace.SpanId parentSpanId)
The parent span id associated for this span, which may be null.
|
abstract TestSpanData.Builder |
setResource(Resource resource)
Set the
Resource associated with this span. |
abstract TestSpanData.Builder |
setSpanId(io.opentelemetry.trace.SpanId spanId)
Set the span id on this builder.
|
abstract TestSpanData.Builder |
setStartEpochNanos(long epochNanos)
Set the start timestamp of the span.
|
abstract TestSpanData.Builder |
setStatus(io.opentelemetry.trace.Status status)
Set the status for this span.
|
abstract TestSpanData.Builder |
setTotalAttributeCount(int totalAttributeCount)
Set the total number of attributes recorded on this span.
|
abstract TestSpanData.Builder |
setTotalRecordedEvents(int totalRecordedEvents)
Set the total number of events recorded on this span.
|
abstract TestSpanData.Builder |
setTotalRecordedLinks(int totalRecordedLinks)
Set the total number of links recorded on this span.
|
abstract TestSpanData.Builder |
setTraceFlags(io.opentelemetry.trace.TraceFlags traceFlags)
Set the
TraceFlags on this builder. |
abstract TestSpanData.Builder |
setTraceId(io.opentelemetry.trace.TraceId traceId)
Set the trace id on this builder.
|
abstract TestSpanData.Builder |
setTraceState(io.opentelemetry.trace.TraceState traceState)
Set the
TraceState on this builder. |
public TestSpanData build()
public abstract TestSpanData.Builder setTraceId(io.opentelemetry.trace.TraceId traceId)
traceId
- the trace id.public abstract TestSpanData.Builder setSpanId(io.opentelemetry.trace.SpanId spanId)
spanId
- the span id.public abstract TestSpanData.Builder setTraceFlags(io.opentelemetry.trace.TraceFlags traceFlags)
TraceFlags
on this builder.traceFlags
- the trace flags.public abstract TestSpanData.Builder setTraceState(io.opentelemetry.trace.TraceState traceState)
TraceState
on this builder.traceState
- the TraceState
.public abstract TestSpanData.Builder setParentSpanId(io.opentelemetry.trace.SpanId parentSpanId)
parentSpanId
- the SpanId of the parentpublic abstract TestSpanData.Builder setResource(Resource resource)
Resource
associated with this span. Must not be null.resource
- the Resource that generated this span.public abstract TestSpanData.Builder setInstrumentationLibraryInfo(InstrumentationLibraryInfo instrumentationLibraryInfo)
instrumentationLibraryInfo
- the instrumentation library of the tracer which created
this span.public abstract TestSpanData.Builder setName(String name)
name
- the name.public abstract TestSpanData.Builder setStartEpochNanos(long epochNanos)
epochNanos
- the start epoch timestamp in nanos.public abstract TestSpanData.Builder setEndEpochNanos(long epochNanos)
epochNanos
- the end epoch timestamp in nanos.public abstract TestSpanData.Builder setAttributes(io.opentelemetry.common.ReadableAttributes attributes)
attributes
- a Map<String, AttributeValue> of attributes.AttributeValue
public abstract TestSpanData.Builder setEvents(List<SpanData.Event> events)
events
- A List<Event> of events associated with this span.Event
public abstract TestSpanData.Builder setStatus(io.opentelemetry.trace.Status status)
status
- The Status of this span.public abstract TestSpanData.Builder setKind(io.opentelemetry.trace.Span.Kind kind)
kind
- The Kind of span.public abstract TestSpanData.Builder setLinks(List<SpanData.Link> links)
links
- A List<Link>Link
public abstract TestSpanData.Builder setHasRemoteParent(boolean hasRemoteParent)
hasRemoteParent
- A boolean indicating if the span has a remote parent.public abstract TestSpanData.Builder setHasEnded(boolean hasEnded)
hasEnded
- A boolean indicating if the span has been ended.public abstract TestSpanData.Builder setTotalRecordedEvents(int totalRecordedEvents)
totalRecordedEvents
- The total number of events recorded.public abstract TestSpanData.Builder setTotalRecordedLinks(int totalRecordedLinks)
totalRecordedLinks
- The total number of links recorded.public abstract TestSpanData.Builder setTotalAttributeCount(int totalAttributeCount)
totalAttributeCount
- The total number of attributes recorded.