Documentation ¶
Index ¶
- Constants
- type JSONMarshaler
- type JSONUnmarshaler
- type MarshalSizer
- type Marshaler
- type ProtoMarshaler
- type ProtoUnmarshaler
- type ResourceSpans
- func (ms ResourceSpans) CopyTo(dest ResourceSpans)
- func (ms ResourceSpans) IsNil() bool
- func (ms ResourceSpans) MoveTo(dest ResourceSpans)
- func (ms ResourceSpans) Resource() pcommon.Resource
- func (ms ResourceSpans) SchemaUrl() string
- func (ms ResourceSpans) ScopeSpans() ScopeSpansSlice
- func (ms ResourceSpans) SetSchemaUrl(v string)
- type ResourceSpansSlice
- func (es ResourceSpansSlice) AppendEmpty() ResourceSpans
- func (es ResourceSpansSlice) At(i int) ResourceSpans
- func (es ResourceSpansSlice) CopyTo(dest ResourceSpansSlice)
- func (es ResourceSpansSlice) EnsureCapacity(newCap int)
- func (es ResourceSpansSlice) Len() int
- func (es ResourceSpansSlice) MoveAndAppendTo(dest ResourceSpansSlice)
- func (es ResourceSpansSlice) RemoveIf(f func(ResourceSpans) bool)
- func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool)
- type ScopeSpans
- func (ms ScopeSpans) CopyTo(dest ScopeSpans)
- func (ms ScopeSpans) IsNil() bool
- func (ms ScopeSpans) MoveTo(dest ScopeSpans)
- func (ms ScopeSpans) SchemaUrl() string
- func (ms ScopeSpans) Scope() pcommon.InstrumentationScope
- func (ms ScopeSpans) SetSchemaUrl(v string)
- func (ms ScopeSpans) Spans() SpanSlice
- type ScopeSpansSlice
- func (es ScopeSpansSlice) AppendEmpty() ScopeSpans
- func (es ScopeSpansSlice) At(i int) ScopeSpans
- func (es ScopeSpansSlice) CopyTo(dest ScopeSpansSlice)
- func (es ScopeSpansSlice) EnsureCapacity(newCap int)
- func (es ScopeSpansSlice) Len() int
- func (es ScopeSpansSlice) MoveAndAppendTo(dest ScopeSpansSlice)
- func (es ScopeSpansSlice) RemoveIf(f func(ScopeSpans) bool)
- func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool)
- type Sizer
- type Span
- func (ms Span) Attributes() pcommon.Map
- func (ms Span) CopyTo(dest Span)
- func (ms Span) DroppedAttributesCount() uint32
- func (ms Span) DroppedEventsCount() uint32
- func (ms Span) DroppedLinksCount() uint32
- func (ms Span) EndTimestamp() pcommon.Timestamp
- func (ms Span) Events() SpanEventSlice
- func (ms Span) Flags() uint32
- func (ms Span) IsNil() bool
- func (ms Span) Kind() SpanKind
- func (ms Span) Links() SpanLinkSlice
- func (ms Span) MoveTo(dest Span)
- func (ms Span) Name() string
- func (ms Span) ParentSpanID() (pcommon.SpanID, bool)
- func (ms Span) SetDroppedAttributesCount(v uint32)
- func (ms Span) SetDroppedEventsCount(v uint32)
- func (ms Span) SetDroppedLinksCount(v uint32)
- func (ms Span) SetEndTimestamp(v pcommon.Timestamp)
- func (ms Span) SetFlags(v uint32)
- func (ms Span) SetKind(v SpanKind)
- func (ms Span) SetName(v string)
- func (ms Span) SetParentSpanID(v pcommon.SpanID)
- func (ms Span) SetSpanID(v pcommon.SpanID)
- func (ms Span) SetStartTimestamp(v pcommon.Timestamp)
- func (ms Span) SetTraceID(v pcommon.TraceID)
- func (ms Span) SpanID() (pcommon.SpanID, bool)
- func (ms Span) StartTimestamp() pcommon.Timestamp
- func (ms Span) Status() Status
- func (ms Span) TraceID() (pcommon.TraceID, bool)
- func (ms Span) TraceState() pcommon.TraceState
- type SpanEvent
- func (ms SpanEvent) Attributes() pcommon.Map
- func (ms SpanEvent) CopyTo(dest SpanEvent)
- func (ms SpanEvent) DroppedAttributesCount() uint32
- func (ms SpanEvent) IsNil() bool
- func (ms SpanEvent) MoveTo(dest SpanEvent)
- func (ms SpanEvent) Name() string
- func (ms SpanEvent) SetDroppedAttributesCount(v uint32)
- func (ms SpanEvent) SetName(v string)
- func (ms SpanEvent) SetTimestamp(v pcommon.Timestamp)
- func (ms SpanEvent) Timestamp() pcommon.Timestamp
- type SpanEventSlice
- func (es SpanEventSlice) AppendEmpty() SpanEvent
- func (es SpanEventSlice) At(i int) SpanEvent
- func (es SpanEventSlice) CopyTo(dest SpanEventSlice)
- func (es SpanEventSlice) EnsureCapacity(newCap int)
- func (es SpanEventSlice) Len() int
- func (es SpanEventSlice) MoveAndAppendTo(dest SpanEventSlice)
- func (es SpanEventSlice) RemoveIf(f func(SpanEvent) bool)
- func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool)
- type SpanKind
- type SpanLink
- func (ms SpanLink) Attributes() pcommon.Map
- func (ms SpanLink) CopyTo(dest SpanLink)
- func (ms SpanLink) DroppedAttributesCount() uint32
- func (ms SpanLink) Flags() uint32
- func (ms SpanLink) IsNil() bool
- func (ms SpanLink) MoveTo(dest SpanLink)
- func (ms SpanLink) SetDroppedAttributesCount(v uint32)
- func (ms SpanLink) SetFlags(v uint32)
- func (ms SpanLink) SetSpanID(v pcommon.SpanID)
- func (ms SpanLink) SetTraceID(v pcommon.TraceID)
- func (ms SpanLink) SpanID() (pcommon.SpanID, bool)
- func (ms SpanLink) TraceID() (pcommon.TraceID, bool)
- func (ms SpanLink) TraceState() pcommon.TraceState
- type SpanLinkSlice
- func (es SpanLinkSlice) AppendEmpty() SpanLink
- func (es SpanLinkSlice) At(i int) SpanLink
- func (es SpanLinkSlice) CopyTo(dest SpanLinkSlice)
- func (es SpanLinkSlice) EnsureCapacity(newCap int)
- func (es SpanLinkSlice) Len() int
- func (es SpanLinkSlice) MoveAndAppendTo(dest SpanLinkSlice)
- func (es SpanLinkSlice) RemoveIf(f func(SpanLink) bool)
- func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool)
- type SpanSlice
- func (es SpanSlice) AppendEmpty() Span
- func (es SpanSlice) At(i int) Span
- func (es SpanSlice) CopyTo(dest SpanSlice)
- func (es SpanSlice) EnsureCapacity(newCap int)
- func (es SpanSlice) Len() int
- func (es SpanSlice) MoveAndAppendTo(dest SpanSlice)
- func (es SpanSlice) RemoveIf(f func(Span) bool)
- func (es SpanSlice) Sort(less func(a, b Span) bool)
- type Status
- type StatusCode
- type Traces
- type Unmarshaler
Constants ¶
const ( // SpanKindUnspecified represents that the SpanKind is unspecified, it MUST NOT be used. SpanKindUnspecified = SpanKind(otlptrace.Span_SPAN_KIND_UNSPECIFIED) // SpanKindInternal indicates that the span represents an internal operation within an application, // as opposed to an operation happening at the boundaries. Default value. SpanKindInternal = SpanKind(otlptrace.Span_SPAN_KIND_INTERNAL) // SpanKindServer indicates that the span covers server-side handling of an RPC or other // remote network request. SpanKindServer = SpanKind(otlptrace.Span_SPAN_KIND_SERVER) // SpanKindClient indicates that the span describes a request to some remote service. SpanKindClient = SpanKind(otlptrace.Span_SPAN_KIND_CLIENT) // SpanKindProducer indicates that the span describes a producer sending a message to a broker. // Unlike CLIENT and SERVER, there is often no direct critical path latency relationship // between producer and consumer spans. // A PRODUCER span ends when the message was accepted by the broker while the logical processing of // the message might span a much longer time. SpanKindProducer = SpanKind(otlptrace.Span_SPAN_KIND_PRODUCER) // SpanKindConsumer indicates that the span describes consumer receiving a message from a broker. // Like the PRODUCER kind, there is often no direct critical path latency relationship between // producer and consumer spans. SpanKindConsumer = SpanKind(otlptrace.Span_SPAN_KIND_CONSUMER) )
const ( StatusCodeUnset = StatusCode(otlptrace.Status_STATUS_CODE_UNSET) StatusCodeOk = StatusCode(otlptrace.Status_STATUS_CODE_OK) StatusCodeError = StatusCode(otlptrace.Status_STATUS_CODE_ERROR) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONMarshaler ¶
type JSONMarshaler struct{}
JSONMarshaler marshals pdata.Traces to JSON bytes using the OTLP/JSON format.
func (*JSONMarshaler) MarshalTraces ¶
func (*JSONMarshaler) MarshalTraces(td Traces) ([]byte, error)
MarshalTraces to the OTLP/JSON format.
type JSONUnmarshaler ¶
type JSONUnmarshaler struct{}
JSONUnmarshaler unmarshals OTLP/JSON formatted-bytes to pdata.Traces.
func (*JSONUnmarshaler) UnmarshalTraces ¶
func (*JSONUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error)
UnmarshalTraces from OTLP/JSON format into pdata.Traces.
type MarshalSizer ¶
MarshalSizer is the interface that groups the basic Marshal and Size methods
type Marshaler ¶
type Marshaler interface { // MarshalTraces the given pdata.Traces into bytes. // If the error is not nil, the returned bytes slice cannot be used. MarshalTraces(td Traces) ([]byte, error) }
Marshaler marshals pdata.Traces into bytes.
type ProtoMarshaler ¶
type ProtoMarshaler struct{}
func (*ProtoMarshaler) MarshalTraces ¶
func (e *ProtoMarshaler) MarshalTraces(td Traces) ([]byte, error)
func (*ProtoMarshaler) TracesSize ¶
func (e *ProtoMarshaler) TracesSize(td Traces) int
type ProtoUnmarshaler ¶
type ProtoUnmarshaler struct{}
func (*ProtoUnmarshaler) UnmarshalTraces ¶
func (d *ProtoUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error)
type ResourceSpans ¶
type ResourceSpans struct {
// contains filtered or unexported fields
}
ResourceSpans is a collection of spans from a Resource.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewResourceSpans function to create new instances. Important: zero-initialized instance is not valid for use.
func NewResourceSpans ¶
func NewResourceSpans() ResourceSpans
NewResourceSpans creates a new empty ResourceSpans.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (ResourceSpans) CopyTo ¶
func (ms ResourceSpans) CopyTo(dest ResourceSpans)
CopyTo copies all properties from the current struct overriding the destination.
func (ResourceSpans) IsNil ¶
func (ms ResourceSpans) IsNil() bool
IsNil returns whether the struct is nil value.
func (ResourceSpans) MoveTo ¶
func (ms ResourceSpans) MoveTo(dest ResourceSpans)
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (ResourceSpans) Resource ¶
func (ms ResourceSpans) Resource() pcommon.Resource
Resource returns the resource associated with this ResourceSpans.
func (ResourceSpans) SchemaUrl ¶
func (ms ResourceSpans) SchemaUrl() string
SchemaUrl returns the schemaurl associated with this ResourceSpans.
func (ResourceSpans) ScopeSpans ¶
func (ms ResourceSpans) ScopeSpans() ScopeSpansSlice
ScopeSpans returns the ScopeSpans associated with this ResourceSpans.
func (ResourceSpans) SetSchemaUrl ¶
func (ms ResourceSpans) SetSchemaUrl(v string)
SetSchemaUrl replaces the schemaurl associated with this ResourceSpans.
type ResourceSpansSlice ¶
type ResourceSpansSlice struct {
// contains filtered or unexported fields
}
ResourceSpansSlice logically represents a slice of ResourceSpans.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewResourceSpansSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewResourceSpansSlice ¶
func NewResourceSpansSlice() ResourceSpansSlice
NewResourceSpansSlice creates a ResourceSpansSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (ResourceSpansSlice) AppendEmpty ¶
func (es ResourceSpansSlice) AppendEmpty() ResourceSpans
AppendEmpty will append to the end of the slice an empty ResourceSpans. It returns the newly added ResourceSpans.
func (ResourceSpansSlice) At ¶
func (es ResourceSpansSlice) At(i int) ResourceSpans
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (ResourceSpansSlice) CopyTo ¶
func (es ResourceSpansSlice) CopyTo(dest ResourceSpansSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (ResourceSpansSlice) EnsureCapacity ¶
func (es ResourceSpansSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new ResourceSpansSlice can be initialized:
es := NewResourceSpansSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (ResourceSpansSlice) Len ¶
func (es ResourceSpansSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewResourceSpansSlice()".
func (ResourceSpansSlice) MoveAndAppendTo ¶
func (es ResourceSpansSlice) MoveAndAppendTo(dest ResourceSpansSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ResourceSpansSlice) RemoveIf ¶
func (es ResourceSpansSlice) RemoveIf(f func(ResourceSpans) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (ResourceSpansSlice) Sort ¶
func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool)
Sort sorts the ResourceSpans elements within ResourceSpansSlice given the provided less function so that two instances of ResourceSpansSlice can be compared.
type ScopeSpans ¶
type ScopeSpans struct {
// contains filtered or unexported fields
}
ScopeSpans is a collection of spans from a LibraryInstrumentation.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewScopeSpans function to create new instances. Important: zero-initialized instance is not valid for use.
func NewScopeSpans ¶
func NewScopeSpans() ScopeSpans
NewScopeSpans creates a new empty ScopeSpans.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (ScopeSpans) CopyTo ¶
func (ms ScopeSpans) CopyTo(dest ScopeSpans)
CopyTo copies all properties from the current struct overriding the destination.
func (ScopeSpans) IsNil ¶
func (ms ScopeSpans) IsNil() bool
IsNil returns whether the struct is nil value.
func (ScopeSpans) MoveTo ¶
func (ms ScopeSpans) MoveTo(dest ScopeSpans)
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (ScopeSpans) SchemaUrl ¶
func (ms ScopeSpans) SchemaUrl() string
SchemaUrl returns the schemaurl associated with this ScopeSpans.
func (ScopeSpans) Scope ¶
func (ms ScopeSpans) Scope() pcommon.InstrumentationScope
Scope returns the scope associated with this ScopeSpans.
func (ScopeSpans) SetSchemaUrl ¶
func (ms ScopeSpans) SetSchemaUrl(v string)
SetSchemaUrl replaces the schemaurl associated with this ScopeSpans.
func (ScopeSpans) Spans ¶
func (ms ScopeSpans) Spans() SpanSlice
Spans returns the Spans associated with this ScopeSpans.
type ScopeSpansSlice ¶
type ScopeSpansSlice struct {
// contains filtered or unexported fields
}
ScopeSpansSlice logically represents a slice of ScopeSpans.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewScopeSpansSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewScopeSpansSlice ¶
func NewScopeSpansSlice() ScopeSpansSlice
NewScopeSpansSlice creates a ScopeSpansSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (ScopeSpansSlice) AppendEmpty ¶
func (es ScopeSpansSlice) AppendEmpty() ScopeSpans
AppendEmpty will append to the end of the slice an empty ScopeSpans. It returns the newly added ScopeSpans.
func (ScopeSpansSlice) At ¶
func (es ScopeSpansSlice) At(i int) ScopeSpans
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (ScopeSpansSlice) CopyTo ¶
func (es ScopeSpansSlice) CopyTo(dest ScopeSpansSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (ScopeSpansSlice) EnsureCapacity ¶
func (es ScopeSpansSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new ScopeSpansSlice can be initialized:
es := NewScopeSpansSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (ScopeSpansSlice) Len ¶
func (es ScopeSpansSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewScopeSpansSlice()".
func (ScopeSpansSlice) MoveAndAppendTo ¶
func (es ScopeSpansSlice) MoveAndAppendTo(dest ScopeSpansSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ScopeSpansSlice) RemoveIf ¶
func (es ScopeSpansSlice) RemoveIf(f func(ScopeSpans) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (ScopeSpansSlice) Sort ¶
func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool)
Sort sorts the ScopeSpans elements within ScopeSpansSlice given the provided less function so that two instances of ScopeSpansSlice can be compared.
type Sizer ¶
type Sizer interface { // TracesSize returns the size in bytes of a marshaled Traces. TracesSize(td Traces) int }
Sizer is an optional interface implemented by the Marshaler, that calculates the size of a marshaled Traces.
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span represents a single operation within a trace. See Span definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewSpan function to create new instances. Important: zero-initialized instance is not valid for use.
func NewSpan ¶
func NewSpan() Span
NewSpan creates a new empty Span.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Span) Attributes ¶
Attributes returns the Attributes associated with this Span.
func (Span) CopyTo ¶
CopyTo copies all properties from the current struct overriding the destination.
func (Span) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this Span.
func (Span) DroppedEventsCount ¶
DroppedEventsCount returns the droppedeventscount associated with this Span.
func (Span) DroppedLinksCount ¶
DroppedLinksCount returns the droppedlinkscount associated with this Span.
func (Span) EndTimestamp ¶
EndTimestamp returns the endtimestamp associated with this Span.
func (Span) Events ¶
func (ms Span) Events() SpanEventSlice
Events returns the Events associated with this Span.
func (Span) Links ¶
func (ms Span) Links() SpanLinkSlice
Links returns the Links associated with this Span.
func (Span) MoveTo ¶
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (Span) ParentSpanID ¶
ParentSpanID returns the parentspanid associated with this Span. Returns the span id and whether it exists.
func (Span) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this Span.
func (Span) SetDroppedEventsCount ¶
SetDroppedEventsCount replaces the droppedeventscount associated with this Span.
func (Span) SetDroppedLinksCount ¶
SetDroppedLinksCount replaces the droppedlinkscount associated with this Span.
func (Span) SetEndTimestamp ¶
SetEndTimestamp replaces the endtimestamp associated with this Span.
func (Span) SetParentSpanID ¶
SetParentSpanID replaces the parentspanid associated with this Span.
func (Span) SetStartTimestamp ¶
SetStartTimestamp replaces the starttimestamp associated with this Span.
func (Span) SetTraceID ¶
SetTraceID replaces the traceid associated with this Span.
func (Span) SpanID ¶
SpanID returns the spanid associated with this Span. Returns the span id and whether it exists.
func (Span) StartTimestamp ¶
StartTimestamp returns the starttimestamp associated with this Span.
func (Span) TraceState ¶
func (ms Span) TraceState() pcommon.TraceState
TraceState returns the tracestate associated with this Span.
type SpanEvent ¶
type SpanEvent struct {
// contains filtered or unexported fields
}
SpanEvent is a time-stamped annotation of the span, consisting of user-supplied text description and key-value pairs. See OTLP for event definition.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewSpanEvent function to create new instances. Important: zero-initialized instance is not valid for use.
func NewSpanEvent ¶
func NewSpanEvent() SpanEvent
NewSpanEvent creates a new empty SpanEvent.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (SpanEvent) Attributes ¶
Attributes returns the Attributes associated with this SpanEvent.
func (SpanEvent) CopyTo ¶
CopyTo copies all properties from the current struct overriding the destination.
func (SpanEvent) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent.
func (SpanEvent) MoveTo ¶
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (SpanEvent) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent.
func (SpanEvent) SetTimestamp ¶
SetTimestamp replaces the timestamp associated with this SpanEvent.
type SpanEventSlice ¶
type SpanEventSlice struct {
// contains filtered or unexported fields
}
SpanEventSlice logically represents a slice of SpanEvent.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewSpanEventSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewSpanEventSlice ¶
func NewSpanEventSlice() SpanEventSlice
NewSpanEventSlice creates a SpanEventSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (SpanEventSlice) AppendEmpty ¶
func (es SpanEventSlice) AppendEmpty() SpanEvent
AppendEmpty will append to the end of the slice an empty SpanEvent. It returns the newly added SpanEvent.
func (SpanEventSlice) At ¶
func (es SpanEventSlice) At(i int) SpanEvent
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (SpanEventSlice) CopyTo ¶
func (es SpanEventSlice) CopyTo(dest SpanEventSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (SpanEventSlice) EnsureCapacity ¶
func (es SpanEventSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new SpanEventSlice can be initialized:
es := NewSpanEventSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (SpanEventSlice) Len ¶
func (es SpanEventSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSpanEventSlice()".
func (SpanEventSlice) MoveAndAppendTo ¶
func (es SpanEventSlice) MoveAndAppendTo(dest SpanEventSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (SpanEventSlice) RemoveIf ¶
func (es SpanEventSlice) RemoveIf(f func(SpanEvent) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (SpanEventSlice) Sort ¶
func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool)
Sort sorts the SpanEvent elements within SpanEventSlice given the provided less function so that two instances of SpanEventSlice can be compared.
type SpanKind ¶
type SpanKind int32
SpanKind is the type of span. Can be used to specify additional relationships between spans in addition to a parent/child relationship.
type SpanLink ¶
type SpanLink struct {
// contains filtered or unexported fields
}
SpanLink is a pointer from the current span to another span in the same trace or in a different trace. See Link definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewSpanLink function to create new instances. Important: zero-initialized instance is not valid for use.
func NewSpanLink ¶
func NewSpanLink() SpanLink
NewSpanLink creates a new empty SpanLink.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (SpanLink) Attributes ¶
Attributes returns the Attributes associated with this SpanLink.
func (SpanLink) CopyTo ¶
CopyTo copies all properties from the current struct overriding the destination.
func (SpanLink) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this SpanLink.
func (SpanLink) MoveTo ¶
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (SpanLink) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink.
func (SpanLink) SetTraceID ¶
SetTraceID replaces the traceid associated with this SpanLink.
func (SpanLink) TraceState ¶
func (ms SpanLink) TraceState() pcommon.TraceState
TraceState returns the tracestate associated with this SpanLink.
type SpanLinkSlice ¶
type SpanLinkSlice struct {
// contains filtered or unexported fields
}
SpanLinkSlice logically represents a slice of SpanLink.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewSpanLinkSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewSpanLinkSlice ¶
func NewSpanLinkSlice() SpanLinkSlice
NewSpanLinkSlice creates a SpanLinkSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (SpanLinkSlice) AppendEmpty ¶
func (es SpanLinkSlice) AppendEmpty() SpanLink
AppendEmpty will append to the end of the slice an empty SpanLink. It returns the newly added SpanLink.
func (SpanLinkSlice) At ¶
func (es SpanLinkSlice) At(i int) SpanLink
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (SpanLinkSlice) CopyTo ¶
func (es SpanLinkSlice) CopyTo(dest SpanLinkSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (SpanLinkSlice) EnsureCapacity ¶
func (es SpanLinkSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new SpanLinkSlice can be initialized:
es := NewSpanLinkSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (SpanLinkSlice) Len ¶
func (es SpanLinkSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSpanLinkSlice()".
func (SpanLinkSlice) MoveAndAppendTo ¶
func (es SpanLinkSlice) MoveAndAppendTo(dest SpanLinkSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (SpanLinkSlice) RemoveIf ¶
func (es SpanLinkSlice) RemoveIf(f func(SpanLink) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (SpanLinkSlice) Sort ¶
func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool)
Sort sorts the SpanLink elements within SpanLinkSlice given the provided less function so that two instances of SpanLinkSlice can be compared.
type SpanSlice ¶
type SpanSlice struct {
// contains filtered or unexported fields
}
SpanSlice logically represents a slice of Span.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewSpanSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewSpanSlice ¶
func NewSpanSlice() SpanSlice
NewSpanSlice creates a SpanSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (SpanSlice) AppendEmpty ¶
AppendEmpty will append to the end of the slice an empty Span. It returns the newly added Span.
func (SpanSlice) At ¶
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (SpanSlice) CopyTo ¶
CopyTo copies all elements from the current slice overriding the destination.
func (SpanSlice) EnsureCapacity ¶
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new SpanSlice can be initialized:
es := NewSpanSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (SpanSlice) Len ¶
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSpanSlice()".
func (SpanSlice) MoveAndAppendTo ¶
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is an optional final status for this span. Semantically, when Status was not set, that means the span ended without errors and to assume Status.Ok (code = 0).
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewStatus function to create new instances. Important: zero-initialized instance is not valid for use.
func NewStatus ¶
func NewStatus() Status
NewStatus creates a new empty Status.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Status) Code ¶
func (ms Status) Code() StatusCode
Code returns the code associated with this Status.
func (Status) CopyTo ¶
CopyTo copies all properties from the current struct overriding the destination.
func (Status) MoveTo ¶
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (Status) SetCode ¶
func (ms Status) SetCode(v StatusCode)
SetCode replaces the code associated with this Status.
func (Status) SetMessage ¶
SetMessage replaces the message associated with this Status.
type StatusCode ¶
type StatusCode int32
StatusCode mirrors the codes defined at https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status
func (StatusCode) String ¶
func (sc StatusCode) String() string
String returns the string representation of the StatusCode.
type Traces ¶
Traces is the top-level struct that is propagated through the traces pipeline. Use NewTraces to create new instance, zero-initialized instance is not valid for use.
func (Traces) IsReadOnly ¶
IsReadOnly returns true if this Traces instance is read-only.
func (Traces) MarkReadOnly ¶
func (ms Traces) MarkReadOnly()
MarkReadOnly marks the Traces as shared so that no further modifications can be done on it.
func (Traces) ResourceSpans ¶
func (ms Traces) ResourceSpans() ResourceSpansSlice
ResourceSpans returns the ResourceSpansSlice associated with this Metrics.
type Unmarshaler ¶
type Unmarshaler interface { // UnmarshalTraces the given bytes into pdata.Traces. // If the error is not nil, the returned pdata.Traces cannot be used. UnmarshalTraces(buf []byte) (Traces, error) }
Unmarshaler unmarshalls bytes into pdata.Traces.
Source Files ¶
- encoding.go
- generated_resourcespans.go
- generated_resourcespansslice.go
- generated_scopespans.go
- generated_scopespansslice.go
- generated_span.go
- generated_spanevent.go
- generated_spaneventslice.go
- generated_spanlink.go
- generated_spanlinkslice.go
- generated_spanslice.go
- generated_status.go
- json.go
- pb.go
- span_kind.go
- status_code.go
- traces.go