ptrace

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 395

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 added in v0.63.0

type JSONMarshaler struct{}

JSONMarshaler marshals pdata.Traces to JSON bytes using the OTLP/JSON format.

func (*JSONMarshaler) MarshalTraces added in v0.63.0

func (*JSONMarshaler) MarshalTraces(td Traces) ([]byte, error)

MarshalTraces to the OTLP/JSON format.

type JSONUnmarshaler added in v0.63.0

type JSONUnmarshaler struct{}

JSONUnmarshaler unmarshals OTLP/JSON formatted-bytes to pdata.Traces.

func (*JSONUnmarshaler) UnmarshalTraces added in v0.63.0

func (*JSONUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error)

UnmarshalTraces from OTLP/JSON format into pdata.Traces.

type MarshalSizer added in v0.60.0

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

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)

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

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

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 added in v0.59.0

func (ms Span) Attributes() pcommon.Map

Attributes returns the Attributes associated with this Span.

func (Span) CopyTo added in v0.59.0

func (ms Span) CopyTo(dest Span)

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

func (Span) DroppedAttributesCount added in v0.59.0

func (ms Span) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this Span.

func (Span) DroppedEventsCount added in v0.59.0

func (ms Span) DroppedEventsCount() uint32

DroppedEventsCount returns the droppedeventscount associated with this Span.

func (Span) DroppedLinksCount added in v0.59.0

func (ms Span) DroppedLinksCount() uint32

DroppedLinksCount returns the droppedlinkscount associated with this Span.

func (Span) EndTimestamp added in v0.59.0

func (ms Span) EndTimestamp() pcommon.Timestamp

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) Flags added in v1.3.0

func (ms Span) Flags() uint32

Flags returns the flags associated with this Span.

func (Span) Kind added in v0.59.0

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 added in v0.59.0

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 added in v0.59.0

func (ms Span) Name() string

Name returns the name associated with this Span.

func (Span) ParentSpanID added in v0.59.0

func (ms Span) ParentSpanID() pcommon.SpanID

ParentSpanID returns the parentspanid associated with this Span.

func (Span) SetDroppedAttributesCount added in v0.59.0

func (ms Span) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this Span.

func (Span) SetDroppedEventsCount added in v0.59.0

func (ms Span) SetDroppedEventsCount(v uint32)

SetDroppedEventsCount replaces the droppedeventscount associated with this Span.

func (Span) SetDroppedLinksCount added in v0.59.0

func (ms Span) SetDroppedLinksCount(v uint32)

SetDroppedLinksCount replaces the droppedlinkscount associated with this Span.

func (Span) SetEndTimestamp added in v0.59.0

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

SetEndTimestamp replaces the endtimestamp associated with this Span.

func (Span) SetFlags added in v1.3.0

func (ms Span) SetFlags(v uint32)

SetFlags replaces the flags associated with this Span.

func (Span) SetKind added in v0.59.0

func (ms Span) SetKind(v SpanKind)

SetKind replaces the kind associated with this Span.

func (Span) SetName added in v0.59.0

func (ms Span) SetName(v string)

SetName replaces the name associated with this Span.

func (Span) SetParentSpanID added in v0.59.0

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

SetParentSpanID replaces the parentspanid associated with this Span.

func (Span) SetSpanID added in v0.59.0

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

SetSpanID replaces the spanid associated with this Span.

func (Span) SetStartTimestamp added in v0.59.0

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

SetStartTimestamp replaces the starttimestamp associated with this Span.

func (Span) SetTraceID added in v0.59.0

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

SetTraceID replaces the traceid associated with this Span.

func (Span) SpanID added in v0.59.0

func (ms Span) SpanID() pcommon.SpanID

SpanID returns the spanid associated with this Span.

func (Span) StartTimestamp added in v0.59.0

func (ms Span) StartTimestamp() pcommon.Timestamp

StartTimestamp returns the starttimestamp associated with this Span.

func (Span) Status added in v0.59.0

func (ms Span) Status() Status

Status returns the status associated with this Span.

func (Span) TraceID added in v0.59.0

func (ms Span) TraceID() pcommon.TraceID

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

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 added in v0.59.0

func (ms SpanEvent) Attributes() pcommon.Map

Attributes returns the Attributes associated with this SpanEvent.

func (SpanEvent) CopyTo added in v0.59.0

func (ms SpanEvent) CopyTo(dest SpanEvent)

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

func (SpanEvent) DroppedAttributesCount added in v0.59.0

func (ms SpanEvent) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent.

func (SpanEvent) MoveTo added in v0.59.0

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 added in v0.59.0

func (ms SpanEvent) Name() string

Name returns the name associated with this SpanEvent.

func (SpanEvent) SetDroppedAttributesCount added in v0.59.0

func (ms SpanEvent) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent.

func (SpanEvent) SetName added in v0.59.0

func (ms SpanEvent) SetName(v string)

SetName replaces the name associated with this SpanEvent.

func (SpanEvent) SetTimestamp added in v0.59.0

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

SetTimestamp replaces the timestamp associated with this SpanEvent.

func (SpanEvent) Timestamp added in v0.59.0

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

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 added in v0.59.0

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 added in v0.59.0

func (ms SpanLink) Attributes() pcommon.Map

Attributes returns the Attributes associated with this SpanLink.

func (SpanLink) CopyTo added in v0.59.0

func (ms SpanLink) CopyTo(dest SpanLink)

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

func (SpanLink) DroppedAttributesCount added in v0.59.0

func (ms SpanLink) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanLink.

func (SpanLink) Flags added in v1.3.0

func (ms SpanLink) Flags() uint32

Flags returns the flags associated with this SpanLink.

func (SpanLink) MoveTo added in v0.59.0

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 added in v0.59.0

func (ms SpanLink) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink.

func (SpanLink) SetFlags added in v1.3.0

func (ms SpanLink) SetFlags(v uint32)

SetFlags replaces the flags associated with this SpanLink.

func (SpanLink) SetSpanID added in v0.59.0

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

SetSpanID replaces the spanid associated with this SpanLink.

func (SpanLink) SetTraceID added in v0.59.0

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

SetTraceID replaces the traceid associated with this SpanLink.

func (SpanLink) SpanID added in v0.59.0

func (ms SpanLink) SpanID() pcommon.SpanID

SpanID returns the spanid associated with this SpanLink.

func (SpanLink) TraceID added in v0.59.0

func (ms SpanLink) TraceID() pcommon.TraceID

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

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 added in v0.59.0

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 added in v0.59.0

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 added in v0.59.0

func (es SpanSlice) CopyTo(dest SpanSlice)

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

func (SpanSlice) EnsureCapacity added in v0.59.0

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 added in v0.59.0

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 added in v0.59.0

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 added in v0.59.0

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 added in v0.59.0

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 added in v0.62.0

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

func (ms Status) CopyTo(dest Status)

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

func (Status) Message added in v0.62.0

func (ms Status) Message() string

Message returns the message associated with this Status.

func (Status) MoveTo added in v0.62.0

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

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 added in v0.59.0

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 added in v0.61.0

func (ms Traces) CopyTo(dest Traces)

CopyTo copies the Traces instance overriding the destination.

func (Traces) IsReadOnly added in v1.0.0

func (ms Traces) IsReadOnly() bool

IsReadOnly returns true if this Traces instance is read-only.

func (Traces) MarkReadOnly added in v1.0.0

func (ms Traces) MarkReadOnly()

MarkReadOnly marks the Traces as shared so that no further modifications can be done on it.

func (Traces) ResourceSpans added in v0.59.0

func (ms Traces) ResourceSpans() ResourceSpansSlice

ResourceSpans returns the ResourceSpansSlice associated with this Metrics.

func (Traces) SpanCount added in v0.59.0

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