Documentation ¶
Index ¶
- Constants
- type JSONMarshaler
- type JSONUnmarshaler
- type MarshalSizer
- func NewProtoMarshaler() MarshalSizerdeprecated
- type Marshaler
- func NewJSONMarshaler() Marshalerdeprecated
- type ProtoMarshaler
- type ProtoUnmarshaler
- type ResourceSpans
- type ResourceSpansSlice
- func (es ResourceSpansSlice) AppendEmpty() ResourceSpans
- func (es ResourceSpansSlice) At(ix 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) ResourceSpansSlice
- type ScopeSpans
- type ScopeSpansSlice
- func (es ScopeSpansSlice) AppendEmpty() ScopeSpans
- func (es ScopeSpansSlice) At(ix 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) ScopeSpansSlice
- 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) Kind() SpanKind
- func (ms Span) Links() SpanLinkSlice
- func (ms Span) MoveTo(dest Span)
- func (ms Span) Name() string
- func (ms Span) ParentSpanID() pcommon.SpanID
- 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) 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
- func (ms Span) StartTimestamp() pcommon.Timestamp
- func (ms Span) Status() Status
- func (ms Span) TraceID() pcommon.TraceID
- 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) 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(ix 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) SpanEventSlice
- type SpanKind
- type SpanLink
- func (ms SpanLink) Attributes() pcommon.Map
- func (ms SpanLink) CopyTo(dest SpanLink)
- func (ms SpanLink) DroppedAttributesCount() uint32
- func (ms SpanLink) MoveTo(dest SpanLink)
- func (ms SpanLink) SetDroppedAttributesCount(v uint32)
- func (ms SpanLink) SetSpanID(v pcommon.SpanID)
- func (ms SpanLink) SetTraceID(v pcommon.TraceID)
- func (ms SpanLink) SpanID() pcommon.SpanID
- func (ms SpanLink) TraceID() pcommon.TraceID
- func (ms SpanLink) TraceState() pcommon.TraceState
- type SpanLinkSlice
- func (es SpanLinkSlice) AppendEmpty() SpanLink
- func (es SpanLinkSlice) At(ix 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) SpanLinkSlice
- type SpanSlice
- func (es SpanSlice) AppendEmpty() Span
- func (es SpanSlice) At(ix 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) SpanSlice
- type Status
- type StatusCode
- type Traces
- type Unmarshaler
- func NewJSONUnmarshaler() Unmarshalerdeprecated
- func NewProtoUnmarshaler() Unmarshalerdeprecated
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 ¶ added in v0.63.0
type JSONMarshaler struct{}
func (*JSONMarshaler) MarshalTraces ¶ added in v0.63.0
func (*JSONMarshaler) MarshalTraces(td Traces) ([]byte, error)
type JSONUnmarshaler ¶ added in v0.63.0
type JSONUnmarshaler struct{}
func (*JSONUnmarshaler) UnmarshalTraces ¶ added in v0.63.0
func (*JSONUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error)
type MarshalSizer ¶ added in v0.60.0
MarshalSizer is the interface that groups the basic Marshal and Size methods
func NewProtoMarshaler
deprecated
func NewProtoMarshaler() MarshalSizer
Deprecated: [v0.63.0] use &ProtoMarshaler{}
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.
func NewJSONMarshaler
deprecated
func NewJSONMarshaler() Marshaler
Deprecated: [v0.63.0] use &JSONMarshaler{}
type ProtoMarshaler ¶ added in v0.63.0
type ProtoMarshaler struct{}
func (*ProtoMarshaler) MarshalTraces ¶ added in v0.63.0
func (e *ProtoMarshaler) MarshalTraces(td Traces) ([]byte, error)
func (*ProtoMarshaler) TracesSize ¶ added in v0.63.0
func (e *ProtoMarshaler) TracesSize(td Traces) int
type ProtoUnmarshaler ¶ added in v0.63.0
type ProtoUnmarshaler struct{}
func (*ProtoUnmarshaler) UnmarshalTraces ¶ added in v0.63.0
func (d *ProtoUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error)
type ResourceSpans ¶
type ResourceSpans internal.ResourceSpans
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 ¶ added in v0.59.0
func (ms ResourceSpans) CopyTo(dest ResourceSpans)
CopyTo copies all properties from the current struct overriding the destination.
func (ResourceSpans) MoveTo ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (ms ResourceSpans) Resource() pcommon.Resource
Resource returns the resource associated with this ResourceSpans.
func (ResourceSpans) SchemaUrl ¶ added in v0.59.0
func (ms ResourceSpans) SchemaUrl() string
SchemaUrl returns the schemaurl associated with this ResourceSpans.
func (ResourceSpans) ScopeSpans ¶ added in v0.59.0
func (ms ResourceSpans) ScopeSpans() ScopeSpansSlice
ScopeSpans returns the ScopeSpans associated with this ResourceSpans.
func (ResourceSpans) SetSchemaUrl ¶ added in v0.59.0
func (ms ResourceSpans) SetSchemaUrl(v string)
SetSchemaUrl replaces the schemaurl associated with this ResourceSpans.
type ResourceSpansSlice ¶
type ResourceSpansSlice internal.ResourceSpansSlice
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es ResourceSpansSlice) At(ix 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 ¶ added in v0.59.0
func (es ResourceSpansSlice) CopyTo(dest ResourceSpansSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (ResourceSpansSlice) EnsureCapacity ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool) ResourceSpansSlice
Sort sorts the ResourceSpans elements within ResourceSpansSlice given the provided less function so that two instances of ResourceSpansSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b ResourceSpans) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type ScopeSpans ¶
type ScopeSpans internal.ScopeSpans
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 ¶ added in v0.59.0
func (ms ScopeSpans) CopyTo(dest ScopeSpans)
CopyTo copies all properties from the current struct overriding the destination.
func (ScopeSpans) MoveTo ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (ms ScopeSpans) SchemaUrl() string
SchemaUrl returns the schemaurl associated with this ScopeSpans.
func (ScopeSpans) Scope ¶ added in v0.59.0
func (ms ScopeSpans) Scope() pcommon.InstrumentationScope
Scope returns the scope associated with this ScopeSpans.
func (ScopeSpans) SetSchemaUrl ¶ added in v0.59.0
func (ms ScopeSpans) SetSchemaUrl(v string)
SetSchemaUrl replaces the schemaurl associated with this ScopeSpans.
func (ScopeSpans) Spans ¶ added in v0.59.0
func (ms ScopeSpans) Spans() SpanSlice
Spans returns the Spans associated with this ScopeSpans.
type ScopeSpansSlice ¶
type ScopeSpansSlice internal.ScopeSpansSlice
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es ScopeSpansSlice) At(ix 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 ¶ added in v0.59.0
func (es ScopeSpansSlice) CopyTo(dest ScopeSpansSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (ScopeSpansSlice) EnsureCapacity ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool) ScopeSpansSlice
Sort sorts the ScopeSpans elements within ScopeSpansSlice given the provided less function so that two instances of ScopeSpansSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b ScopeSpans) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
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 ¶
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 ¶ added in v0.59.0
Attributes returns the Attributes associated with this Span.
func (Span) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct overriding the destination.
func (Span) DroppedAttributesCount ¶ added in v0.59.0
DroppedAttributesCount returns the droppedattributescount associated with this Span.
func (Span) DroppedEventsCount ¶ added in v0.59.0
DroppedEventsCount returns the droppedeventscount associated with this Span.
func (Span) DroppedLinksCount ¶ added in v0.59.0
DroppedLinksCount returns the droppedlinkscount associated with this Span.
func (Span) EndTimestamp ¶ added in v0.59.0
EndTimestamp returns the endtimestamp associated with this Span.
func (Span) Events ¶ added in v0.59.0
func (ms Span) Events() SpanEventSlice
Events returns the Events associated with this Span.
func (Span) Links ¶ added in v0.59.0
func (ms Span) Links() SpanLinkSlice
Links returns the Links associated with this Span.
func (Span) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (Span) ParentSpanID ¶ added in v0.59.0
ParentSpanID returns the parentspanid associated with this Span.
func (Span) SetDroppedAttributesCount ¶ added in v0.59.0
SetDroppedAttributesCount replaces the droppedattributescount associated with this Span.
func (Span) SetDroppedEventsCount ¶ added in v0.59.0
SetDroppedEventsCount replaces the droppedeventscount associated with this Span.
func (Span) SetDroppedLinksCount ¶ added in v0.59.0
SetDroppedLinksCount replaces the droppedlinkscount associated with this Span.
func (Span) SetEndTimestamp ¶ added in v0.59.0
SetEndTimestamp replaces the endtimestamp associated with this Span.
func (Span) SetParentSpanID ¶ added in v0.59.0
SetParentSpanID replaces the parentspanid associated with this Span.
func (Span) SetStartTimestamp ¶ added in v0.59.0
SetStartTimestamp replaces the starttimestamp associated with this Span.
func (Span) SetTraceID ¶ added in v0.59.0
SetTraceID replaces the traceid associated with this Span.
func (Span) StartTimestamp ¶ added in v0.59.0
StartTimestamp returns the starttimestamp associated with this Span.
func (Span) TraceState ¶ added in v0.59.0
func (ms Span) TraceState() pcommon.TraceState
TraceState returns the tracestate associated with this Span.
type SpanEvent ¶
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 ¶ added in v0.59.0
Attributes returns the Attributes associated with this SpanEvent.
func (SpanEvent) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct overriding the destination.
func (SpanEvent) DroppedAttributesCount ¶ added in v0.59.0
DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent.
func (SpanEvent) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (SpanEvent) SetDroppedAttributesCount ¶ added in v0.59.0
SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent.
func (SpanEvent) SetName ¶ added in v0.59.0
SetName replaces the name associated with this SpanEvent.
func (SpanEvent) SetTimestamp ¶ added in v0.59.0
SetTimestamp replaces the timestamp associated with this SpanEvent.
type SpanEventSlice ¶
type SpanEventSlice internal.SpanEventSlice
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es SpanEventSlice) At(ix 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 ¶ added in v0.59.0
func (es SpanEventSlice) CopyTo(dest SpanEventSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (SpanEventSlice) EnsureCapacity ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool) SpanEventSlice
Sort sorts the SpanEvent elements within SpanEventSlice given the provided less function so that two instances of SpanEventSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b SpanEvent) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
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 ¶
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 ¶ added in v0.59.0
Attributes returns the Attributes associated with this SpanLink.
func (SpanLink) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct overriding the destination.
func (SpanLink) DroppedAttributesCount ¶ added in v0.59.0
DroppedAttributesCount returns the droppedattributescount associated with this SpanLink.
func (SpanLink) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (SpanLink) SetDroppedAttributesCount ¶ added in v0.59.0
SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink.
func (SpanLink) SetSpanID ¶ added in v0.59.0
SetSpanID replaces the spanid associated with this SpanLink.
func (SpanLink) SetTraceID ¶ added in v0.59.0
SetTraceID replaces the traceid associated with this SpanLink.
func (SpanLink) TraceID ¶ added in v0.59.0
TraceID returns the traceid associated with this SpanLink.
func (SpanLink) TraceState ¶ added in v0.59.0
func (ms SpanLink) TraceState() pcommon.TraceState
TraceState returns the tracestate associated with this SpanLink.
type SpanLinkSlice ¶
type SpanLinkSlice internal.SpanLinkSlice
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es SpanLinkSlice) At(ix 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 ¶ added in v0.59.0
func (es SpanLinkSlice) CopyTo(dest SpanLinkSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (SpanLinkSlice) EnsureCapacity ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
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 ¶ added in v0.59.0
func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool) SpanLinkSlice
Sort sorts the SpanLink elements within SpanLinkSlice given the provided less function so that two instances of SpanLinkSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b SpanLink) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type SpanSlice ¶
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 ¶ added in v0.59.0
AppendEmpty will append to the end of the slice an empty Span. It returns the newly added Span.
func (SpanSlice) At ¶ added in v0.59.0
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 ¶ added in v0.59.0
CopyTo copies all elements from the current slice overriding the destination.
func (SpanSlice) EnsureCapacity ¶ added in v0.59.0
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 ¶ added in v0.59.0
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSpanSlice()".
func (SpanSlice) MoveAndAppendTo ¶ added in v0.59.0
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (SpanSlice) RemoveIf ¶ added in v0.59.0
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (SpanSlice) Sort ¶ added in v0.59.0
Sort sorts the Span elements within SpanSlice given the provided less function so that two instances of SpanSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b Span) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type Status ¶ added in v0.62.0
func NewStatus ¶ added in v0.62.0
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 ¶ added in v0.62.0
func (ms Status) Code() StatusCode
Code returns the code associated with this Status.
func (Status) CopyTo ¶ added in v0.62.0
CopyTo copies all properties from the current struct overriding the destination.
func (Status) MoveTo ¶ added in v0.62.0
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (Status) SetCode ¶ added in v0.62.0
func (ms Status) SetCode(v StatusCode)
SetCode replaces the code associated with this Status.
func (Status) SetMessage ¶ added in v0.62.0
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 ¶ added in v0.59.0
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) CopyTo ¶ added in v0.61.0
CopyTo copies the Traces instance overriding the destination.
func (Traces) MoveTo ¶ added in v0.59.0
MoveTo moves the Traces instance overriding the destination and resetting the current instance to its zero value.
func (Traces) ResourceSpans ¶ added in v0.59.0
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.
func NewJSONUnmarshaler
deprecated
func NewJSONUnmarshaler() Unmarshaler
Deprecated: [v0.63.0] use &JSONUnmarshaler{}
func NewProtoUnmarshaler
deprecated
func NewProtoUnmarshaler() Unmarshaler
Deprecated: [v0.63.0] use &ProtoUnmarshaler{}