Class Span
java.lang.Object
io.mishmash.opentelemetry.server.collector.Batch<Flow.Subscriber<? super T>>
io.mishmash.opentelemetry.server.collector.SubscribersBatch<Span>
io.mishmash.opentelemetry.server.collector.Span
Holds the details of an individual OTLP span record
received from a client as a
Batch of all subscribers
that are expected to process it.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the timestamp when the containing OTLP packet was received.Get the unique id of the containing OTLP packet.Get the message associated with an error in the data.io.opentelemetry.proto.resource.v1.ResourceGet the OpenTelemetry Resource of this span.Get the schema URL of the OpenTelemetry Resouce of this span.io.opentelemetry.proto.common.v1.InstrumentationScopegetScope()Get the OpenTelemetry Scope of this span.intgetSeqNo()Get the sequence number of this span within the containing OTLP packet.io.opentelemetry.proto.trace.v1.SpangetSpan()Get the OpenTelemetry Span.Get the schema URL of the OpenTelemetry Span.booleanisValid()Check if this record is valid.voidsetFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.trace.v1.ResourceSpans resourceSpan, io.opentelemetry.proto.trace.v1.ScopeSpans scopeSpan, io.opentelemetry.proto.trace.v1.Span otelSpan) Set the details of this span.Methods inherited from class io.mishmash.opentelemetry.server.collector.SubscribersBatch
otelCompleteMethods inherited from class io.mishmash.opentelemetry.server.collector.Batch
add, addAll, cancel, complete, completeExceptionally, currentOtelScope, future, getOtelContext, getProcessedElements, isCancelled, isLoaded, setLoaded, setLoadFailed
-
Constructor Details
-
Span
Create a new empty span.- Parameters:
parent- parentBatchotelContext-Contextfor own telemetry
-
-
Method Details
-
setFrom
public void setFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.trace.v1.ResourceSpans resourceSpan, io.opentelemetry.proto.trace.v1.ScopeSpans scopeSpan, io.opentelemetry.proto.trace.v1.Span otelSpan) Set the details of this span. Also sets the validity of this record and potentially an error message.- Parameters:
batchTS- the batch timestampbatchID- the batch idsequenceNum- the sequence number of this spanresourceSpan- used to fill-in OpenTelemetry Resource detailsscopeSpan- used to fill-in OpenTelemetry Scope detailsotelSpan- the span details
-
getBatchTimestamp
public long getBatchTimestamp()Get the timestamp when the containing OTLP packet was received.- Returns:
- the timestamp, in ms
-
getBatchUUID
Get the unique id of the containing OTLP packet.- Returns:
- the UUID
-
getSeqNo
public int getSeqNo()Get the sequence number of this span within the containing OTLP packet.- Returns:
- the sequence number, zero-based
-
getResource
public io.opentelemetry.proto.resource.v1.Resource getResource()Get the OpenTelemetry Resource of this span.- Returns:
- the resource details
-
getResourceSchemaUrl
Get the schema URL of the OpenTelemetry Resouce of this span.- Returns:
- the schema URL
-
getScope
public io.opentelemetry.proto.common.v1.InstrumentationScope getScope()Get the OpenTelemetry Scope of this span.- Returns:
- the scope details
-
getSpan
public io.opentelemetry.proto.trace.v1.Span getSpan()Get the OpenTelemetry Span.- Returns:
- the span details
-
getSpanSchemaUrl
Get the schema URL of the OpenTelemetry Span.- Returns:
- the schema URL
-
isValid
public boolean isValid()Check if this record is valid.- Returns:
- true if data is valid
-
getErrorMessage
Get the message associated with an error in the data.- Returns:
- the error message or null if data is valid
-