Class ResourceSpansMarshaler
- java.lang.Object
-
- io.opentelemetry.exporter.internal.marshal.Marshaler
-
- io.opentelemetry.exporter.internal.marshal.MarshalerWithSize
-
- io.opentelemetry.exporter.internal.otlp.traces.ResourceSpansMarshaler
-
public final class ResourceSpansMarshaler extends MarshalerWithSize
A Marshaler of ResourceSpans.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Field Summary
Fields Modifier and Type Field Description private InstrumentationScopeSpansMarshaler[]
instrumentationScopeSpansMarshalers
private ResourceMarshaler
resourceMarshaler
private byte[]
schemaUrlUtf8
-
Constructor Summary
Constructors Constructor Description ResourceSpansMarshaler(ResourceMarshaler resourceMarshaler, byte[] schemaUrlUtf8, InstrumentationScopeSpansMarshaler[] instrumentationScopeSpansMarshalers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
calculateSize(ResourceMarshaler resourceMarshaler, byte[] schemaUrlUtf8, InstrumentationScopeSpansMarshaler[] instrumentationScopeSpansMarshalers)
static ResourceSpansMarshaler[]
create(java.util.Collection<SpanData> spanDataList)
Returns Marshalers of ResourceSpans created by grouping the provided SpanData.private static java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<SpanMarshaler>>>
groupByResourceAndScope(java.util.Collection<SpanData> spanDataList)
void
writeTo(Serializer output)
-
Methods inherited from class io.opentelemetry.exporter.internal.marshal.MarshalerWithSize
getBinarySerializedSize
-
Methods inherited from class io.opentelemetry.exporter.internal.marshal.Marshaler
writeBinaryTo, writeJsonTo, writeJsonTo, writeJsonWithNewline
-
-
-
-
Field Detail
-
resourceMarshaler
private final ResourceMarshaler resourceMarshaler
-
schemaUrlUtf8
private final byte[] schemaUrlUtf8
-
instrumentationScopeSpansMarshalers
private final InstrumentationScopeSpansMarshaler[] instrumentationScopeSpansMarshalers
-
-
Constructor Detail
-
ResourceSpansMarshaler
ResourceSpansMarshaler(ResourceMarshaler resourceMarshaler, byte[] schemaUrlUtf8, InstrumentationScopeSpansMarshaler[] instrumentationScopeSpansMarshalers)
-
-
Method Detail
-
create
public static ResourceSpansMarshaler[] create(java.util.Collection<SpanData> spanDataList)
Returns Marshalers of ResourceSpans created by grouping the provided SpanData.
-
writeTo
public void writeTo(Serializer output) throws java.io.IOException
-
calculateSize
private static int calculateSize(ResourceMarshaler resourceMarshaler, byte[] schemaUrlUtf8, InstrumentationScopeSpansMarshaler[] instrumentationScopeSpansMarshalers)
-
groupByResourceAndScope
private static java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<SpanMarshaler>>> groupByResourceAndScope(java.util.Collection<SpanData> spanDataList)
-
-