ptrace

package
v0.0.0-...-76a0d45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Index

Constants

View Source
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)
)

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

type MarshalSizer interface {
	Marshaler
	Sizer
}

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

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

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

func (ms Span) Attributes() pcommon.Map

Attributes returns the Attributes associated with this Span.

func (Span) CopyTo

func (ms Span) CopyTo(dest Span)

CopyTo copies all properties from the current struct overriding the destination.

func (Span) DroppedAttributesCount

func (ms Span) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this Span.

func (Span) DroppedEventsCount

func (ms Span) DroppedEventsCount() uint32

DroppedEventsCount returns the droppedeventscount associated with this Span.

func (Span) DroppedLinksCount

func (ms Span) DroppedLinksCount() uint32

DroppedLinksCount returns the droppedlinkscount associated with this Span.

func (Span) EndTimestamp

func (ms Span) EndTimestamp() pcommon.Timestamp

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) Flags

func (ms Span) Flags() uint32

Flags returns the flags associated with this Span.

func (Span) IsNil

func (ms Span) IsNil() bool

IsNil returns whether the struct is nil value.

func (Span) Kind

func (ms Span) Kind() SpanKind

Kind returns the kind associated with this Span.

func (ms Span) Links() SpanLinkSlice

Links returns the Links associated with this Span.

func (Span) MoveTo

func (ms Span) MoveTo(dest Span)

MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value

func (Span) Name

func (ms Span) Name() string

Name returns the name associated with this Span.

func (Span) ParentSpanID

func (ms Span) ParentSpanID() (pcommon.SpanID, bool)

ParentSpanID returns the parentspanid associated with this Span. Returns the span id and whether it exists.

func (Span) SetDroppedAttributesCount

func (ms Span) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this Span.

func (Span) SetDroppedEventsCount

func (ms Span) SetDroppedEventsCount(v uint32)

SetDroppedEventsCount replaces the droppedeventscount associated with this Span.

func (Span) SetDroppedLinksCount

func (ms Span) SetDroppedLinksCount(v uint32)

SetDroppedLinksCount replaces the droppedlinkscount associated with this Span.

func (Span) SetEndTimestamp

func (ms Span) SetEndTimestamp(v pcommon.Timestamp)

SetEndTimestamp replaces the endtimestamp associated with this Span.

func (Span) SetFlags

func (ms Span) SetFlags(v uint32)

SetFlags replaces the flags associated with this Span.

func (Span) SetKind

func (ms Span) SetKind(v SpanKind)

SetKind replaces the kind associated with this Span.

func (Span) SetName

func (ms Span) SetName(v string)

SetName replaces the name associated with this Span.

func (Span) SetParentSpanID

func (ms Span) SetParentSpanID(v pcommon.SpanID)

SetParentSpanID replaces the parentspanid associated with this Span.

func (Span) SetSpanID

func (ms Span) SetSpanID(v pcommon.SpanID)

SetSpanID replaces the spanid associated with this Span.

func (Span) SetStartTimestamp

func (ms Span) SetStartTimestamp(v pcommon.Timestamp)

SetStartTimestamp replaces the starttimestamp associated with this Span.

func (Span) SetTraceID

func (ms Span) SetTraceID(v pcommon.TraceID)

SetTraceID replaces the traceid associated with this Span.

func (Span) SpanID

func (ms Span) SpanID() (pcommon.SpanID, bool)

SpanID returns the spanid associated with this Span. Returns the span id and whether it exists.

func (Span) StartTimestamp

func (ms Span) StartTimestamp() pcommon.Timestamp

StartTimestamp returns the starttimestamp associated with this Span.

func (Span) Status

func (ms Span) Status() Status

Status returns the status associated with this Span.

func (Span) TraceID

func (ms Span) TraceID() (pcommon.TraceID, bool)

TraceID returns the traceid 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

func (ms SpanEvent) Attributes() pcommon.Map

Attributes returns the Attributes associated with this SpanEvent.

func (SpanEvent) CopyTo

func (ms SpanEvent) CopyTo(dest SpanEvent)

CopyTo copies all properties from the current struct overriding the destination.

func (SpanEvent) DroppedAttributesCount

func (ms SpanEvent) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent.

func (SpanEvent) IsNil

func (ms SpanEvent) IsNil() bool

IsNil returns whether the struct is nil value.

func (SpanEvent) MoveTo

func (ms SpanEvent) MoveTo(dest SpanEvent)

MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value

func (SpanEvent) Name

func (ms SpanEvent) Name() string

Name returns the name associated with this SpanEvent.

func (SpanEvent) SetDroppedAttributesCount

func (ms SpanEvent) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent.

func (SpanEvent) SetName

func (ms SpanEvent) SetName(v string)

SetName replaces the name associated with this SpanEvent.

func (SpanEvent) SetTimestamp

func (ms SpanEvent) SetTimestamp(v pcommon.Timestamp)

SetTimestamp replaces the timestamp associated with this SpanEvent.

func (SpanEvent) Timestamp

func (ms SpanEvent) Timestamp() pcommon.Timestamp

Timestamp returns 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.

func (SpanKind) String

func (sk SpanKind) String() string

String returns the string representation of the SpanKind.

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() 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

func (ms SpanLink) Attributes() pcommon.Map

Attributes returns the Attributes associated with this SpanLink.

func (SpanLink) CopyTo

func (ms SpanLink) CopyTo(dest SpanLink)

CopyTo copies all properties from the current struct overriding the destination.

func (SpanLink) DroppedAttributesCount

func (ms SpanLink) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanLink.

func (SpanLink) Flags

func (ms SpanLink) Flags() uint32

Flags returns the flags associated with this SpanLink.

func (SpanLink) IsNil

func (ms SpanLink) IsNil() bool

IsNil returns whether the struct is nil value.

func (SpanLink) MoveTo

func (ms SpanLink) MoveTo(dest SpanLink)

MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value

func (SpanLink) SetDroppedAttributesCount

func (ms SpanLink) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink.

func (SpanLink) SetFlags

func (ms SpanLink) SetFlags(v uint32)

SetFlags replaces the flags associated with this SpanLink.

func (SpanLink) SetSpanID

func (ms SpanLink) SetSpanID(v pcommon.SpanID)

SetSpanID replaces the spanid associated with this SpanLink.

func (SpanLink) SetTraceID

func (ms SpanLink) SetTraceID(v pcommon.TraceID)

SetTraceID replaces the traceid associated with this SpanLink.

func (SpanLink) SpanID

func (ms SpanLink) SpanID() (pcommon.SpanID, bool)

SpanID returns the spanid associated with this SpanLink.

func (SpanLink) TraceID

func (ms SpanLink) TraceID() (pcommon.TraceID, bool)

TraceID returns 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

func (es SpanSlice) AppendEmpty() Span

AppendEmpty will append to the end of the slice an empty Span. It returns the newly added Span.

func (SpanSlice) At

func (es SpanSlice) At(i int) Span

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

func (es SpanSlice) CopyTo(dest SpanSlice)

CopyTo copies all elements from the current slice overriding the destination.

func (SpanSlice) EnsureCapacity

func (es SpanSlice) 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 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

func (es SpanSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewSpanSlice()".

func (SpanSlice) MoveAndAppendTo

func (es SpanSlice) MoveAndAppendTo(dest SpanSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (SpanSlice) RemoveIf

func (es SpanSlice) RemoveIf(f func(Span) bool)

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

func (es SpanSlice) Sort(less func(a, b Span) bool)

Sort sorts the Span elements within SpanSlice given the provided less function so that two instances of SpanSlice can be compared.

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

func (ms Status) CopyTo(dest Status)

CopyTo copies all properties from the current struct overriding the destination.

func (Status) IsNil

func (ms Status) IsNil() bool

IsNil returns whether the struct is nil value.

func (Status) Message

func (ms Status) Message() string

Message returns the message associated with this Status.

func (Status) MoveTo

func (ms Status) MoveTo(dest Status)

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

func (ms Status) SetMessage(v string)

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

type Traces internal.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 NewTraces

func NewTraces() Traces

NewTraces creates a new Traces struct.

func (Traces) CopyTo

func (ms Traces) CopyTo(dest Traces)

CopyTo copies the Traces instance overriding the destination.

func (Traces) IsReadOnly

func (ms Traces) IsReadOnly() bool

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.

func (Traces) SpanCount

func (ms Traces) SpanCount() int

SpanCount calculates the total number of spans.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL