idx

package
v0.76.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package idx is used to unmarshal v1.0 Trace payloads

Index

Constants

This section is empty.

Variables

View Source
var (
	SpanKind_name = map[int32]string{
		0: "SPAN_KIND_UNSPECIFIED",
		1: "SPAN_KIND_INTERNAL",
		2: "SPAN_KIND_SERVER",
		3: "SPAN_KIND_CLIENT",
		4: "SPAN_KIND_PRODUCER",
		5: "SPAN_KIND_CONSUMER",
	}
	SpanKind_value = map[string]int32{
		"SPAN_KIND_UNSPECIFIED": 0,
		"SPAN_KIND_INTERNAL":    1,
		"SPAN_KIND_SERVER":      2,
		"SPAN_KIND_CLIENT":      3,
		"SPAN_KIND_PRODUCER":    4,
		"SPAN_KIND_CONSUMER":    5,
	}
)

Enum value maps for SpanKind.

View Source
var File_datadog_trace_idx_span_proto protoreflect.FileDescriptor
View Source
var File_datadog_trace_idx_tracer_payload_proto protoreflect.FileDescriptor

Functions

func MarshalAttributesMap added in v0.73.0

func MarshalAttributesMap(bts []byte, attributes map[uint32]*AnyValue, strings *StringTable, serStrings *SerializedStrings) (o []byte, err error)

MarshalAttributesMap marshals a map of attributes into a byte stream

func UnmarshalKeyValueMap

func UnmarshalKeyValueMap(bts []byte, strings *StringTable) (kvl map[uint32]*AnyValue, o []byte, err error)

UnmarshalKeyValueMap unmarshals a map of key-value pairs from the byte stream, updating the StringTable with new strings

func UnmarshalStreamingString

func UnmarshalStreamingString(bts []byte, strings *StringTable) (index uint32, o []byte, err error)

UnmarshalStreamingString unmarshals a streaming string from a byte stream, updating the strings slice with new strings For streaming string details see pkg/trace/api/version.go for details

Types

type AnyValue

type AnyValue struct {

	// Types that are valid to be assigned to Value:
	//
	//	*AnyValue_StringValueRef
	//	*AnyValue_BoolValue
	//	*AnyValue_DoubleValue
	//	*AnyValue_IntValue
	//	*AnyValue_BytesValue
	//	*AnyValue_ArrayValue
	//	*AnyValue_KeyValueList
	Value isAnyValue_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

AnyValue is a union of possible value types.

func FromString added in v0.73.0

func FromString(strTable *StringTable, s string) *AnyValue

FromString creates an AnyValue from a string, attempting to use the most backwards compatible type possible Meaning we will prefer IntValue > DoubleValue > StringValue to match the previous metrics vs meta behavior

func UnmarshalAnyValue

func UnmarshalAnyValue(bts []byte, strings *StringTable) (value *AnyValue, o []byte, err error)

UnmarshalAnyValue unmarshals an AnyValue from a byte stream, updating the strings slice with new strings

func (*AnyValue) AsDoubleValue added in v0.73.0

func (av *AnyValue) AsDoubleValue(strTable *StringTable) (float64, error)

AsDoubleValue returns the attribute in float64 format, returning an error if the attribute is not a float64 or can't be converted to a float64

func (*AnyValue) AsString added in v0.73.0

func (av *AnyValue) AsString(strTable *StringTable) string

AsString returns the attribute in string format, this format is backwards compatible with non-v1 behavior

func (*AnyValue) Descriptor deprecated

func (*AnyValue) Descriptor() ([]byte, []int)

Deprecated: Use AnyValue.ProtoReflect.Descriptor instead.

func (*AnyValue) GetArrayValue

func (x *AnyValue) GetArrayValue() *ArrayValue

func (*AnyValue) GetBoolValue

func (x *AnyValue) GetBoolValue() bool

func (*AnyValue) GetBytesValue

func (x *AnyValue) GetBytesValue() []byte

func (*AnyValue) GetDoubleValue

func (x *AnyValue) GetDoubleValue() float64

func (*AnyValue) GetIntValue

func (x *AnyValue) GetIntValue() int64

func (*AnyValue) GetKeyValueList

func (x *AnyValue) GetKeyValueList() *KeyValueList

func (*AnyValue) GetStringValueRef

func (x *AnyValue) GetStringValueRef() uint32

func (*AnyValue) GetValue

func (x *AnyValue) GetValue() isAnyValue_Value

func (*AnyValue) MarshalMsg added in v0.73.0

func (val *AnyValue) MarshalMsg(bts []byte, strings *StringTable, serStrings *SerializedStrings) ([]byte, error)

MarshalMsg marshals an AnyValue into a byte stream

func (*AnyValue) Msgsize added in v0.73.0

func (val *AnyValue) Msgsize() int

Msgsize returns the size of the message when serialized.

func (*AnyValue) ProtoMessage

func (*AnyValue) ProtoMessage()

func (*AnyValue) ProtoReflect

func (x *AnyValue) ProtoReflect() protoreflect.Message

func (*AnyValue) Reset

func (x *AnyValue) Reset()

func (*AnyValue) String

func (x *AnyValue) String() string

type AnyValue_ArrayValue

type AnyValue_ArrayValue struct {
	// arrayValue specifies an array value.
	ArrayValue *ArrayValue `protobuf:"bytes,6,opt,name=arrayValue,proto3,oneof"`
}

type AnyValue_BoolValue

type AnyValue_BoolValue struct {
	// boolValue specifies a bool value.
	BoolValue bool `protobuf:"varint,2,opt,name=boolValue,proto3,oneof"`
}

type AnyValue_BytesValue

type AnyValue_BytesValue struct {
	// bytesValue specifies a bytes value.
	BytesValue []byte `protobuf:"bytes,5,opt,name=bytesValue,proto3,oneof"`
}

type AnyValue_DoubleValue

type AnyValue_DoubleValue struct {
	// doubleValue specifies a double value.
	DoubleValue float64 `protobuf:"fixed64,3,opt,name=doubleValue,proto3,oneof"`
}

type AnyValue_IntValue

type AnyValue_IntValue struct {
	// intValue specifies an int value.
	IntValue int64 `protobuf:"varint,4,opt,name=intValue,proto3,oneof"`
}

type AnyValue_KeyValueList

type AnyValue_KeyValueList struct {
	// keyValueList specifies a list of key-value pairs.
	KeyValueList *KeyValueList `protobuf:"bytes,7,opt,name=keyValueList,proto3,oneof"`
}

type AnyValue_StringValueRef

type AnyValue_StringValueRef struct {
	// stringValueRef specifies the string table ref of a string value.
	StringValueRef uint32 `protobuf:"varint,1,opt,name=stringValueRef,proto3,oneof"`
}

type ArrayValue

type ArrayValue struct {

	// values specifies a repeated list of AnyValue.
	Values []*AnyValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

ArrayValue is a repeated list of AnyValue that is needed since `oneof` in AnyValue cannot be `repeated`

func (*ArrayValue) Descriptor deprecated

func (*ArrayValue) Descriptor() ([]byte, []int)

Deprecated: Use ArrayValue.ProtoReflect.Descriptor instead.

func (*ArrayValue) GetValues

func (x *ArrayValue) GetValues() []*AnyValue

func (*ArrayValue) ProtoMessage

func (*ArrayValue) ProtoMessage()

func (*ArrayValue) ProtoReflect

func (x *ArrayValue) ProtoReflect() protoreflect.Message

func (*ArrayValue) Reset

func (x *ArrayValue) Reset()

func (*ArrayValue) String

func (x *ArrayValue) String() string

type InternalSpan

type InternalSpan struct {
	// Strings referenced in this span. Note this is shared with the tracer payload
	// This should generally not be accessed directly, but rather through the methods on the InternalTracerPayload
	// It is only exposed here for use in other packages that need to construct tracer payloads for testing.
	Strings *StringTable
	// contains filtered or unexported fields
}

InternalSpan is a span structure that is optimized for trace-agent usage Namely it stores Attributes as a map for fast key lookups and holds a pointer to the strings slice so a span holds all local context necessary to understand all fields

func NewInternalSpan added in v0.73.0

func NewInternalSpan(strings *StringTable, span *Span) *InternalSpan

NewInternalSpan creates a new internal span.

func UnmarshalSpanList

func UnmarshalSpanList(bts []byte, strings *StringTable) (spans []*InternalSpan, o []byte, err error)

UnmarshalSpanList unmarshals a list of InternalSpans from a byte stream, updating the strings slice with new strings

func (*InternalSpan) Attributes

func (s *InternalSpan) Attributes() map[uint32]*AnyValue

Attributes returns the attributes of the span.

func (*InternalSpan) Clone added in v0.76.0

func (s *InternalSpan) Clone() *InternalSpan

Clone creates a deep copy of the span and string table so it can be used and modified independently of the original span

func (*InternalSpan) Component added in v0.73.0

func (s *InternalSpan) Component() string

Component returns the component from the span.

func (*InternalSpan) DebugString added in v0.73.0

func (s *InternalSpan) DebugString() string

DebugString returns a human readable string representation of the span

func (*InternalSpan) DeleteAttribute added in v0.73.0

func (s *InternalSpan) DeleteAttribute(key string)

DeleteAttribute deletes an attribute from the span.

func (*InternalSpan) Duration

func (s *InternalSpan) Duration() uint64

Duration returns the duration of the span.

func (*InternalSpan) Env added in v0.73.0

func (s *InternalSpan) Env() string

Env returns the environment from the span.

func (*InternalSpan) Error

func (s *InternalSpan) Error() bool

func (*InternalSpan) Events added in v0.73.0

func (s *InternalSpan) Events() []*InternalSpanEvent

Events returns the spans events in the InternalSpanEvent format

func (*InternalSpan) GetAttribute added in v0.76.0

func (s *InternalSpan) GetAttribute(key string) (*AnyValue, bool)

GetAttribute returns the attribute as the underlying AnyValue

func (*InternalSpan) GetAttributeAsFloat64 added in v0.73.0

func (s *InternalSpan) GetAttributeAsFloat64(key string) (float64, bool)

GetAttributeAsFloat64 returns the attribute as a float64 and a boolean indicating if the attribute was found AND it was able to be converted to a float64

func (*InternalSpan) GetAttributeAsString added in v0.73.0

func (s *InternalSpan) GetAttributeAsString(key string) (string, bool)

GetAttributeAsString returns the attribute as a string, or an empty string if the attribute is not found

func (*InternalSpan) Kind

func (s *InternalSpan) Kind() SpanKind

Kind returns the span kind.

func (s *InternalSpan) LenLinks() int

LenLinks returns the number of links in the span.

func (s *InternalSpan) Links() []*InternalSpanLink

Links returns the spans links in the InternalSpanLink format

func (*InternalSpan) MapAttributesAsStrings added in v0.73.0

func (s *InternalSpan) MapAttributesAsStrings(f func(k, v string) string)

MapAttributesAsStrings maps over all string attributes and applies the given function to each attribute Note that this will only act on true attributes, fields like env, version, component, etc are not considered The provided function will receive all attributes as strings, and should return the new value for the attribute

func (*InternalSpan) MapFilteredAttributes added in v0.76.0

func (s *InternalSpan) MapFilteredAttributes(shouldMap func(k string) bool, mapper func(k, v string) string)

MapFilterAttributes maps over all attributes where shouldMap returns true and applies the given function to each attribute Note that this will only act on true attributes, fields like env, version, component, etc are not considered The provided function will receive all attributes as strings, and should return the new value for the attribute

func (*InternalSpan) MapStringAttributes added in v0.73.0

func (s *InternalSpan) MapStringAttributes(f MapStringAttributesFunc)

MapStringAttributes maps over all string attributes and applies the given function to each attribute Note that this will only act on true attributes, fields like env, version, component, etc are not considered The provided function will only act on attributes that are string types

func (*InternalSpan) MarshalMsg added in v0.73.0

func (span *InternalSpan) MarshalMsg(bts []byte, serStrings *SerializedStrings) (o []byte, err error)

MarshalMsg marshals a Span into a byte stream

func (*InternalSpan) Msgsize added in v0.73.0

func (s *InternalSpan) Msgsize() int

Msgsize returns the size of the message when serialized.

func (*InternalSpan) Name added in v0.73.0

func (s *InternalSpan) Name() string

Name returns the span name.

func (*InternalSpan) ParentID

func (s *InternalSpan) ParentID() uint64

ParentID returns the parent span ID.

func (*InternalSpan) Resource added in v0.73.0

func (s *InternalSpan) Resource() string

Resource returns the resource from the span.

func (*InternalSpan) Service added in v0.73.0

func (s *InternalSpan) Service() string

Service returns the service name from the span.

func (*InternalSpan) SetAttributeFromString added in v0.73.0

func (s *InternalSpan) SetAttributeFromString(key, value string)

SetAttributeFromString sets the attribute from a string, attempting to use the most backwards compatible type possible for the attribute value. Meaning we will prefer DoubleValue > IntValue > StringValue to match the previous metrics vs meta behavior For backwards compatibility, env, version, component, and span.kind will be set as fields instead of attributes

func (*InternalSpan) SetComponent added in v0.73.0

func (s *InternalSpan) SetComponent(component string)

SetComponent sets the component for the span.

func (*InternalSpan) SetDuration added in v0.73.0

func (s *InternalSpan) SetDuration(duration uint64)

SetDuration sets the duration of the span.

func (*InternalSpan) SetEnv added in v0.73.0

func (s *InternalSpan) SetEnv(e string)

SetEnv sets the environment for the span.

func (*InternalSpan) SetError added in v0.73.0

func (s *InternalSpan) SetError(error bool)

SetError sets the error flag for the span.

func (*InternalSpan) SetFloat64Attribute added in v0.73.0

func (s *InternalSpan) SetFloat64Attribute(key string, value float64)

SetFloat64Attribute sets a float64 attribute for the span.

func (*InternalSpan) SetName added in v0.73.0

func (s *InternalSpan) SetName(name string)

SetName sets the span name.

func (*InternalSpan) SetParentID added in v0.73.0

func (s *InternalSpan) SetParentID(parentID uint64)

SetParentID sets the parent span ID.

func (*InternalSpan) SetResource added in v0.73.0

func (s *InternalSpan) SetResource(resource string)

SetResource sets the resource for the span.

func (*InternalSpan) SetService added in v0.73.0

func (s *InternalSpan) SetService(svc string)

SetService sets the service name for the span.

func (*InternalSpan) SetSpanID added in v0.73.0

func (s *InternalSpan) SetSpanID(spanID uint64)

SetSpanID sets the span ID.

func (*InternalSpan) SetSpanKind added in v0.73.0

func (s *InternalSpan) SetSpanKind(kind SpanKind)

SetSpanKind sets the span kind.

func (*InternalSpan) SetStart added in v0.73.0

func (s *InternalSpan) SetStart(start uint64)

SetStart sets the start time of the span.

func (*InternalSpan) SetStringAttribute added in v0.73.0

func (s *InternalSpan) SetStringAttribute(key, value string)

SetStringAttribute sets the attribute with key and value For backwards compatibility, env, version, component, and span.kind will be set as fields instead of attributes

func (*InternalSpan) SetType added in v0.73.0

func (s *InternalSpan) SetType(t string)

SetType sets the span type.

func (*InternalSpan) SetVersion added in v0.73.0

func (s *InternalSpan) SetVersion(version string)

SetVersion sets the version for the span.

func (*InternalSpan) ShallowCopy added in v0.73.0

func (s *InternalSpan) ShallowCopy() *InternalSpan

ShallowCopy creates a shallow copy of the internal span.

func (*InternalSpan) SpanID

func (s *InternalSpan) SpanID() uint64

SpanID returns the span ID.

func (*InternalSpan) SpanKind added in v0.73.0

func (s *InternalSpan) SpanKind() string

SpanKind returns the string representation of the span kind

func (*InternalSpan) Start

func (s *InternalSpan) Start() uint64

Start returns the start time of the span.

func (*InternalSpan) ToProto added in v0.73.0

func (s *InternalSpan) ToProto() *Span

ToProto converts the internal span to a protobuf span.

func (*InternalSpan) Type added in v0.73.0

func (s *InternalSpan) Type() string

Type returns the span type.

func (*InternalSpan) UnmarshalMsg

func (span *InternalSpan) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg unmarshals the wire representation of a Span from a byte stream, updating the strings slice with new strings directly into an InternalSpan. Note that the Strings field of the InternalSpan must already be initialized.

func (*InternalSpan) Version added in v0.73.0

func (s *InternalSpan) Version() string

Version returns the version from the span.

type InternalSpanEvent

type InternalSpanEvent struct {
	// Strings is a pointer to the strings slice (Shared across a tracer payload)
	Strings *StringTable
	// contains filtered or unexported fields
}

InternalSpanEvent is the canonical internal span event structure

func (*InternalSpanEvent) Attributes

func (se *InternalSpanEvent) Attributes() map[uint32]*AnyValue

Attributes returns the attributes of the span event.

func (*InternalSpanEvent) GetAttribute added in v0.76.0

func (se *InternalSpanEvent) GetAttribute(key string) (*AnyValue, bool)

GetAttribute gets the attribute as the underlying AnyValue

func (*InternalSpanEvent) GetAttributeAsString added in v0.73.0

func (se *InternalSpanEvent) GetAttributeAsString(key string) (string, bool)

GetAttributeAsString gets a string attribute from the span event.

func (*InternalSpanEvent) Name added in v0.73.0

func (se *InternalSpanEvent) Name() string

Name returns the name from the span event.

func (*InternalSpanEvent) SetAttributeFromString added in v0.73.0

func (se *InternalSpanEvent) SetAttributeFromString(key, value string)

SetAttributeFromString sets the attribute on an InternalSpanEvent from a string, attempting to use the most backwards compatible type possible for the attribute value. Meaning we will prefer DoubleValue > IntValue > StringValue to match the previous metrics vs meta behavior

func (*InternalSpanEvent) Time

func (se *InternalSpanEvent) Time() uint64

Time returns the time from the span event.

type InternalSpanLink struct {
	// Strings is a pointer to the strings slice (Shared across a tracer payload)
	Strings *StringTable
	// contains filtered or unexported fields
}

InternalSpanLink is a span link structure that is optimized for trace-agent usage Namely it stores Attributes as a map for fast key lookups

func (*InternalSpanLink) Attributes

func (sl *InternalSpanLink) Attributes() map[uint32]*AnyValue

Attributes returns the attributes of the span link.

func (*InternalSpanLink) Flags added in v0.73.0

func (sl *InternalSpanLink) Flags() uint32

Flags returns the flags from the span link.

func (*InternalSpanLink) GetAttributeAsString added in v0.73.0

func (sl *InternalSpanLink) GetAttributeAsString(key string) (string, bool)

GetAttributeAsString gets a string attribute from the span link.

func (*InternalSpanLink) SetStringAttribute added in v0.73.0

func (sl *InternalSpanLink) SetStringAttribute(key, value string)

SetStringAttribute sets a string attribute for the span link.

func (*InternalSpanLink) SpanID

func (sl *InternalSpanLink) SpanID() uint64

SpanID returns the span ID from the span link.

func (*InternalSpanLink) TraceID

func (sl *InternalSpanLink) TraceID() []byte

TraceID returns the trace ID from the span link.

func (*InternalSpanLink) Tracestate added in v0.73.0

func (sl *InternalSpanLink) Tracestate() string

Tracestate returns the tracestate from the span link.

type InternalTraceChunk

type InternalTraceChunk struct {
	// Strings referenced in this trace chunk. Note this is shared with the tracer payload
	// This should generally not be accessed directly, but rather through the methods on the InternalTracerPayload
	// It is only exposed here for use in other packages that need to construct tracer payloads for testing.
	Strings  *StringTable
	Priority int32

	Attributes   map[uint32]*AnyValue
	Spans        []*InternalSpan
	DroppedTrace bool
	TraceID      []byte
	// contains filtered or unexported fields
}

InternalTraceChunk is a trace chunk structure that is optimized for trace-agent usage Namely it stores Attributes as a map for fast key lookups and holds a pointer to the strings slice so a trace chunk holds all local context necessary to understand all fields

func NewInternalTraceChunk added in v0.73.0

func NewInternalTraceChunk(strings *StringTable, priority int32, origin string, attributes map[uint32]*AnyValue, spans []*InternalSpan, droppedTrace bool, traceID []byte, samplingMechanism uint32) *InternalTraceChunk

NewInternalTraceChunk creates a new internal trace chunk.

func UnmarshalTraceChunkList

func UnmarshalTraceChunkList(bts []byte, strings *StringTable) (chunks []*InternalTraceChunk, o []byte, err error)

UnmarshalTraceChunkList unmarshals a list of TraceChunks from a byte stream, updating the strings slice with new strings

func (*InternalTraceChunk) GetAttributeAsString added in v0.73.0

func (c *InternalTraceChunk) GetAttributeAsString(key string) (string, bool)

GetAttributeAsString returns the attribute as a string, or an empty string if the attribute is not found

func (*InternalTraceChunk) LegacyTraceID added in v0.73.0

func (c *InternalTraceChunk) LegacyTraceID() uint64

LegacyTraceID returns the trace ID of the trace chunk as a uint64, the lowest order 8 bytes of the trace ID are the legacy trace ID

func (*InternalTraceChunk) MarshalMsg added in v0.73.0

func (tc *InternalTraceChunk) MarshalMsg(bts []byte, serStrings *SerializedStrings) (o []byte, err error)

MarshalMsg marshals a TraceChunk into a byte stream

func (*InternalTraceChunk) Msgsize added in v0.73.0

func (c *InternalTraceChunk) Msgsize() int

Msgsize returns the size of the message when serialized.

func (*InternalTraceChunk) Origin added in v0.73.0

func (c *InternalTraceChunk) Origin() string

Origin returns the origin from the trace chunk.

func (*InternalTraceChunk) SamplingMechanism added in v0.73.0

func (c *InternalTraceChunk) SamplingMechanism() uint32

SamplingMechanism returns the sampling mechanism from the trace chunk.

func (*InternalTraceChunk) SetLegacyTraceID added in v0.76.0

func (c *InternalTraceChunk) SetLegacyTraceID(legacyTraceID uint64)

SetLegacyTraceID sets the trace ID of the chunk from a legacy uint64 trace ID, additional bits are set to 0 Warning: This method does not remove any attributes from the chunk or contained spans which might be referring to the upper 8 bytes of the trace ID.

func (*InternalTraceChunk) SetOrigin added in v0.73.0

func (c *InternalTraceChunk) SetOrigin(origin string)

SetOrigin sets the origin for the trace chunk.

func (*InternalTraceChunk) SetSamplingMechanism added in v0.73.0

func (c *InternalTraceChunk) SetSamplingMechanism(samplingMechanism uint32)

SetSamplingMechanism sets the sampling mechanism for the trace chunk.

func (*InternalTraceChunk) SetStringAttribute added in v0.73.0

func (c *InternalTraceChunk) SetStringAttribute(key, value string)

SetStringAttribute sets a string attribute for the trace chunk.

func (*InternalTraceChunk) ShallowCopy added in v0.73.0

func (c *InternalTraceChunk) ShallowCopy() *InternalTraceChunk

ShallowCopy creates a shallow copy of the internal trace chunk. TODO: add a test to verify we have all fields

func (*InternalTraceChunk) ToProto added in v0.73.0

func (c *InternalTraceChunk) ToProto() *TraceChunk

ToProto converts an InternalTraceChunk to a proto TraceChunk

func (*InternalTraceChunk) UnmarshalMsg

func (tc *InternalTraceChunk) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg unmarshals a TraceChunk from a byte stream, updating the strings slice with new strings

type InternalTracerPayload

type InternalTracerPayload struct {
	// Strings referenced in this tracer payload, its chunks and spans
	// This should generally not be accessed directly, but rather through the methods on the InternalTracerPayload
	// It is only exposed here for use in other packages that need to construct tracer payloads for testing.
	Strings *StringTable

	// a collection of key to value pairs common in all `chunks`
	Attributes map[uint32]*AnyValue
	// chunks specifies list of containing trace chunks.
	Chunks []*InternalTraceChunk
	// contains filtered or unexported fields
}

InternalTracerPayload is a tracer payload structure that is optimized for trace-agent usage Namely it stores Attributes as a map for fast key lookups.

func FromProto added in v0.76.0

func FromProto(tp *TracerPayload) *InternalTracerPayload

FromProto creates an InternalTracerPayload from a proto TracerPayload

func (*InternalTracerPayload) AppVersion added in v0.73.0

func (tp *InternalTracerPayload) AppVersion() string

AppVersion returns the application version from the tracer payload.

func (*InternalTracerPayload) ContainerID added in v0.73.0

func (tp *InternalTracerPayload) ContainerID() string

ContainerID returns the container ID from the tracer payload.

func (*InternalTracerPayload) DeleteAttribute added in v0.76.0

func (tp *InternalTracerPayload) DeleteAttribute(key string)

DeleteAttribute deletes an attribute from the tracer payload.

func (*InternalTracerPayload) Env added in v0.73.0

func (tp *InternalTracerPayload) Env() string

Env returns the environment from the tracer payload.

func (*InternalTracerPayload) GetAttributeAsString added in v0.73.0

func (tp *InternalTracerPayload) GetAttributeAsString(key string) (string, bool)

GetAttributeAsString gets a string attribute from the tracer payload.

func (*InternalTracerPayload) Hostname added in v0.73.0

func (tp *InternalTracerPayload) Hostname() string

Hostname returns the hostname from the tracer payload.

func (*InternalTracerPayload) LanguageName added in v0.73.0

func (tp *InternalTracerPayload) LanguageName() string

LanguageName returns the language name from the tracer payload.

func (*InternalTracerPayload) LanguageVersion added in v0.73.0

func (tp *InternalTracerPayload) LanguageVersion() string

LanguageVersion returns the language version from the tracer payload.

func (*InternalTracerPayload) MarshalMsg added in v0.73.0

func (tp *InternalTracerPayload) MarshalMsg(bts []byte) (o []byte, err error)

MarshalMsg marshals a TracerPayload into a byte stream

func (*InternalTracerPayload) Msgsize added in v0.73.0

func (tp *InternalTracerPayload) Msgsize() int

Msgsize returns the size of the message when serialized to messagepack.

func (*InternalTracerPayload) RemoveChunk added in v0.73.0

func (tp *InternalTracerPayload) RemoveChunk(i int)

RemoveChunk removes a chunk by its index.

func (*InternalTracerPayload) ReplaceChunk added in v0.73.0

func (tp *InternalTracerPayload) ReplaceChunk(i int, chunk *InternalTraceChunk)

ReplaceChunk replaces a chunk by its index.

func (*InternalTracerPayload) RuntimeID added in v0.73.0

func (tp *InternalTracerPayload) RuntimeID() string

RuntimeID returns the runtime ID from the tracer payload.

func (*InternalTracerPayload) SetAppVersion added in v0.73.0

func (tp *InternalTracerPayload) SetAppVersion(version string)

SetAppVersion sets the application version for the tracer payload.

func (*InternalTracerPayload) SetAttributes added in v0.73.0

func (tp *InternalTracerPayload) SetAttributes(attributes map[uint32]*AnyValue)

SetAttributes sets the attributes for the tracer payload.

func (*InternalTracerPayload) SetContainerID added in v0.73.0

func (tp *InternalTracerPayload) SetContainerID(containerID string)

SetContainerID sets the container ID for the tracer payload.

func (*InternalTracerPayload) SetEnv added in v0.73.0

func (tp *InternalTracerPayload) SetEnv(env string)

SetEnv sets the environment for the tracer payload.

func (*InternalTracerPayload) SetHostname added in v0.73.0

func (tp *InternalTracerPayload) SetHostname(hostname string)

SetHostname sets the hostname for the tracer payload.

func (*InternalTracerPayload) SetLanguageName added in v0.73.0

func (tp *InternalTracerPayload) SetLanguageName(name string)

SetLanguageName sets the language name in the string table

func (*InternalTracerPayload) SetLanguageVersion added in v0.73.0

func (tp *InternalTracerPayload) SetLanguageVersion(version string)

SetLanguageVersion sets the language version in the string table

func (*InternalTracerPayload) SetRuntimeID added in v0.73.0

func (tp *InternalTracerPayload) SetRuntimeID(runtimeID string)

SetRuntimeID sets the runtime ID for the tracer payload.

func (*InternalTracerPayload) SetStringAttribute added in v0.73.0

func (tp *InternalTracerPayload) SetStringAttribute(key, value string)

SetStringAttribute sets a string attribute for the tracer payload.

func (*InternalTracerPayload) SetTracerVersion added in v0.73.0

func (tp *InternalTracerPayload) SetTracerVersion(version string)

SetTracerVersion sets the tracer version in the string table

func (*InternalTracerPayload) ToProto added in v0.73.0

func (tp *InternalTracerPayload) ToProto() *TracerPayload

ToProto converts an InternalTracerPayload to a proto TracerPayload This returns the structure _AS IS_, so even strings that are no longer referenced may be included in the resulting proto. To ensure that only used strings are included, call RemoveUnusedStrings first.

func (*InternalTracerPayload) TracerVersion added in v0.73.0

func (tp *InternalTracerPayload) TracerVersion() string

TracerVersion returns the tracer version from the tracer payload.

func (*InternalTracerPayload) UnmarshalMsg

func (tp *InternalTracerPayload) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg unmarshals a TracerPayload from a byte stream, updating the strings slice with new strings Returns any leftover bytes after the tracer payload is unmarshalled and any error that occurred

type KeyValue

type KeyValue struct {

	// key specifies the string table ref of a key.
	Key uint32 `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"`
	// value specifies a value.
	Value *AnyValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

KeyValue is a key-value pair where key is a string table ref and value is an AnyValue.

func UnmarshalKeyValueList

func UnmarshalKeyValueList(bts []byte, strings *StringTable) (kvl []*KeyValue, o []byte, err error)

UnmarshalKeyValueList unmarshals a list of key-value pairs from the byte stream, updating the StringTable with new strings

func (*KeyValue) Descriptor deprecated

func (*KeyValue) Descriptor() ([]byte, []int)

Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.

func (*KeyValue) GetKey

func (x *KeyValue) GetKey() uint32

func (*KeyValue) GetValue

func (x *KeyValue) GetValue() *AnyValue

func (*KeyValue) MarshalMsg added in v0.73.0

func (kv *KeyValue) MarshalMsg(bts []byte, strings *StringTable, serStrings *SerializedStrings) (o []byte, err error)

MarshalMsg marshals a KeyValue into a byte stream

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) ProtoReflect

func (x *KeyValue) ProtoReflect() protoreflect.Message

func (*KeyValue) Reset

func (x *KeyValue) Reset()

func (*KeyValue) String

func (x *KeyValue) String() string

type KeyValueList

type KeyValueList struct {

	// keyValues specifies a repeated list of KeyValue.
	KeyValues []*KeyValue `protobuf:"bytes,1,rep,name=keyValues,proto3" json:"keyValues,omitempty"`
	// contains filtered or unexported fields
}

KeyValueList is a repeated list of KeyValue messages that is needed since `oneof` in AnyValue cannot be `repeated` or `map`

func (*KeyValueList) Descriptor deprecated

func (*KeyValueList) Descriptor() ([]byte, []int)

Deprecated: Use KeyValueList.ProtoReflect.Descriptor instead.

func (*KeyValueList) GetKeyValues

func (x *KeyValueList) GetKeyValues() []*KeyValue

func (*KeyValueList) ProtoMessage

func (*KeyValueList) ProtoMessage()

func (*KeyValueList) ProtoReflect

func (x *KeyValueList) ProtoReflect() protoreflect.Message

func (*KeyValueList) Reset

func (x *KeyValueList) Reset()

func (*KeyValueList) String

func (x *KeyValueList) String() string

type MapStringAttributesFunc added in v0.73.0

type MapStringAttributesFunc func(k, v string) (newK string, newV string, shouldReplace bool)

MapStringAttributesFunc is a function that maps over all string attributes and applies the given function to each attribute

type SerializedStrings added in v0.73.0

type SerializedStrings struct {
	// contains filtered or unexported fields
}

SerializedStrings is a helper type that tracks what strings have been serialized and where It is only good for one serialization

func NewSerializedStrings added in v0.73.0

func NewSerializedStrings(numStrings uint32) *SerializedStrings

NewSerializedStrings creates a new SerializedStrings object used to track what strings have been serialized numStrings is the number of strings that will be serialized

func (*SerializedStrings) AppendStreamingString added in v0.73.0

func (s *SerializedStrings) AppendStreamingString(str string, strTableIndex uint32, b []byte) []byte

AppendStreamingString writes str to b if it hasn't been written before, otherwise it writes the serialization index strTableIndex is the location of str in the string table - this is used to track which strings have been written already

type Span

type Span struct {

	// serviceRef specifies the string table ref of this span's service name.
	ServiceRef uint32 `protobuf:"varint,1,opt,name=serviceRef,proto3" json:"serviceRef,omitempty"`
	// nameRef specifies the string table ref of this span's operation name.
	NameRef uint32 `protobuf:"varint,2,opt,name=nameRef,proto3" json:"nameRef,omitempty"`
	// resourceRef specifies the string table ref of this span's resource name.
	ResourceRef uint32 `protobuf:"varint,3,opt,name=resourceRef,proto3" json:"resourceRef,omitempty"`
	// spanID is the ID of this span.
	SpanID uint64 `protobuf:"fixed64,4,opt,name=spanID,proto3" json:"spanID,omitempty"`
	// parentID is the ID of this span's parent, or zero if this span has no parent.
	ParentID uint64 `protobuf:"varint,5,opt,name=parentID,proto3" json:"parentID,omitempty"`
	// start is the number of nanoseconds between the Unix epoch and the beginning of this span.
	Start uint64 `protobuf:"fixed64,6,opt,name=start,proto3" json:"start,omitempty"`
	// duration is the time length of this span in nanoseconds.
	Duration uint64 `protobuf:"varint,7,opt,name=duration,proto3" json:"duration,omitempty"`
	// error specifies if there is an error associated with this span.
	Error bool `protobuf:"varint,8,opt,name=error,proto3" json:"error,omitempty"`
	// attributes is a mapping from attribute key string ref to any value.
	Attributes map[uint32]*AnyValue `` /* 148-byte string literal not displayed */
	// typeRef is the string table ref of the type of the service with which this span is associated.  Example values: web, db, lambda.
	TypeRef uint32 `protobuf:"varint,10,opt,name=typeRef,proto3" json:"typeRef,omitempty"`
	// span_links represents a collection of links, where each link defines a causal relationship between two spans.
	Links []*SpanLink `protobuf:"bytes,11,rep,name=links,proto3" json:"links,omitempty"`
	// spanEvents represent an event at an instant in time related to this span, but not necessarily during the span.
	Events []*SpanEvent `protobuf:"bytes,12,rep,name=events,proto3" json:"events,omitempty"`
	// envRef is the string table ref of the optional string environment of this span.
	EnvRef uint32 `protobuf:"varint,13,opt,name=envRef,proto3" json:"envRef,omitempty"`
	// versionRef is the string table ref of the optional string version of this span.
	VersionRef uint32 `protobuf:"varint,14,opt,name=versionRef,proto3" json:"versionRef,omitempty"`
	// componentRef is the string table ref of the string component name of this span.
	ComponentRef uint32 `protobuf:"varint,15,opt,name=componentRef,proto3" json:"componentRef,omitempty"`
	// kind is the SpanKind of this span as defined in the OTEL Specification.
	Kind SpanKind `protobuf:"varint,16,opt,name=kind,proto3,enum=datadog.trace.idx.SpanKind" json:"kind,omitempty"`
	// contains filtered or unexported fields
}

func (*Span) Clone added in v0.76.0

func (s *Span) Clone() *Span

Clone creates a deep copy of the span so it can be used and modified independently of the original span

func (*Span) Descriptor deprecated

func (*Span) Descriptor() ([]byte, []int)

Deprecated: Use Span.ProtoReflect.Descriptor instead.

func (*Span) GetAttributes

func (x *Span) GetAttributes() map[uint32]*AnyValue

func (*Span) GetComponentRef

func (x *Span) GetComponentRef() uint32

func (*Span) GetDuration

func (x *Span) GetDuration() uint64

func (*Span) GetEnvRef

func (x *Span) GetEnvRef() uint32

func (*Span) GetError

func (x *Span) GetError() bool

func (*Span) GetEvents added in v0.72.0

func (x *Span) GetEvents() []*SpanEvent

func (*Span) GetKind

func (x *Span) GetKind() SpanKind
func (x *Span) GetLinks() []*SpanLink

func (*Span) GetNameRef

func (x *Span) GetNameRef() uint32

func (*Span) GetParentID

func (x *Span) GetParentID() uint64

func (*Span) GetResourceRef

func (x *Span) GetResourceRef() uint32

func (*Span) GetServiceRef

func (x *Span) GetServiceRef() uint32

func (*Span) GetSpanID

func (x *Span) GetSpanID() uint64

func (*Span) GetStart

func (x *Span) GetStart() uint64

func (*Span) GetTypeRef

func (x *Span) GetTypeRef() uint32

func (*Span) GetVersionRef

func (x *Span) GetVersionRef() uint32

func (*Span) ProtoMessage

func (*Span) ProtoMessage()

func (*Span) ProtoReflect

func (x *Span) ProtoReflect() protoreflect.Message

func (*Span) Reset

func (x *Span) Reset()

func (*Span) ShallowCopy added in v0.73.0

func (s *Span) ShallowCopy() *Span

ShallowCopy returns a shallow copy of the span

func (*Span) String

func (x *Span) String() string

type SpanEvent

type SpanEvent struct {

	// time is the number of nanoseconds between the Unix epoch and this event.
	Time uint64 `protobuf:"fixed64,1,opt,name=time,proto3" json:"time,omitempty"`
	// nameRef specifies the string table ref of this event's name.
	NameRef uint32 `protobuf:"varint,2,opt,name=nameRef,proto3" json:"nameRef,omitempty"`
	// attributes is a mapping from attribute key string ref to any value.
	Attributes map[uint32]*AnyValue `` /* 148-byte string literal not displayed */
	// contains filtered or unexported fields
}

func UnmarshalSpanEventList

func UnmarshalSpanEventList(bts []byte, strings *StringTable) (spanEvents []*SpanEvent, o []byte, err error)

UnmarshalSpanEventList unmarshals a list of SpanEvents from a byte stream, updating the strings slice with new strings

func (*SpanEvent) Descriptor deprecated

func (*SpanEvent) Descriptor() ([]byte, []int)

Deprecated: Use SpanEvent.ProtoReflect.Descriptor instead.

func (*SpanEvent) GetAttributes

func (x *SpanEvent) GetAttributes() map[uint32]*AnyValue

func (*SpanEvent) GetNameRef

func (x *SpanEvent) GetNameRef() uint32

func (*SpanEvent) GetTime

func (x *SpanEvent) GetTime() uint64

func (*SpanEvent) MarshalMsg added in v0.73.0

func (spanEvent *SpanEvent) MarshalMsg(bts []byte, strings *StringTable, serStrings *SerializedStrings) (o []byte, err error)

MarshalMsg marshals a SpanEvent into a byte stream

func (*SpanEvent) Msgsize added in v0.73.0

func (spanEvent *SpanEvent) Msgsize() int

Msgsize returns the size of the message when serialized.

func (*SpanEvent) ProtoMessage

func (*SpanEvent) ProtoMessage()

func (*SpanEvent) ProtoReflect

func (x *SpanEvent) ProtoReflect() protoreflect.Message

func (*SpanEvent) Reset

func (x *SpanEvent) Reset()

func (*SpanEvent) String

func (x *SpanEvent) String() string

func (*SpanEvent) UnmarshalMsg added in v0.73.0

func (spanEvent *SpanEvent) UnmarshalMsg(bts []byte, strings *StringTable) (o []byte, err error)

UnmarshalMsg unmarshals a SpanEvent from a byte stream, updating the strings slice with new strings

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.

const (
	// Unspecified. Do NOT use as default.
	// Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED.
	SpanKind_SPAN_KIND_UNSPECIFIED SpanKind = 0
	// Indicates that the span represents an internal operation within an application,
	// as opposed to an operations happening at the boundaries. Default value.
	SpanKind_SPAN_KIND_INTERNAL SpanKind = 1
	// Indicates that the span covers server-side handling of an RPC or other
	// remote network request.
	SpanKind_SPAN_KIND_SERVER SpanKind = 2
	// Indicates that the span describes a request to some remote service.
	SpanKind_SPAN_KIND_CLIENT SpanKind = 3
	// 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.
	SpanKind_SPAN_KIND_PRODUCER SpanKind = 4
	// 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.
	SpanKind_SPAN_KIND_CONSUMER SpanKind = 5
)

func (SpanKind) Descriptor

func (SpanKind) Descriptor() protoreflect.EnumDescriptor

func (SpanKind) Enum

func (x SpanKind) Enum() *SpanKind

func (SpanKind) EnumDescriptor deprecated

func (SpanKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use SpanKind.Descriptor instead.

func (SpanKind) Number

func (x SpanKind) Number() protoreflect.EnumNumber

func (SpanKind) String

func (x SpanKind) String() string

func (SpanKind) Type

type SpanLink struct {

	// traceID specifies the ID of the trace to which this span link belongs.
	TraceID []byte `protobuf:"bytes,1,opt,name=traceID,proto3" json:"traceID,omitempty"`
	// spanID specifies the ID of this span.
	SpanID uint64 `protobuf:"fixed64,2,opt,name=spanID,proto3" json:"spanID,omitempty"`
	// attributes specifies a map of attribute key string ref to any value.
	Attributes map[uint32]*AnyValue `` /* 148-byte string literal not displayed */
	// tracestateRef specifies the string table ref of the W3C tracestate.
	TracestateRef uint32 `protobuf:"varint,4,opt,name=tracestateRef,proto3" json:"tracestateRef,omitempty"`
	// flags specifies the W3C trace flags. Optional. If set, the high bit (bit 31) must be set.
	Flags uint32 `protobuf:"varint,5,opt,name=flags,proto3" json:"flags,omitempty"`
	// contains filtered or unexported fields
}
func UnmarshalSpanLinks(bts []byte, strings *StringTable) (links []*SpanLink, o []byte, err error)

UnmarshalSpanLinks unmarshals a list of SpanLinks from a byte stream, updating the strings slice with new strings

func (*SpanLink) Descriptor deprecated

func (*SpanLink) Descriptor() ([]byte, []int)

Deprecated: Use SpanLink.ProtoReflect.Descriptor instead.

func (*SpanLink) GetAttributes

func (x *SpanLink) GetAttributes() map[uint32]*AnyValue

func (*SpanLink) GetFlags added in v0.72.0

func (x *SpanLink) GetFlags() uint32

func (*SpanLink) GetSpanID

func (x *SpanLink) GetSpanID() uint64

func (*SpanLink) GetTraceID

func (x *SpanLink) GetTraceID() []byte

func (*SpanLink) GetTracestateRef

func (x *SpanLink) GetTracestateRef() uint32

func (*SpanLink) MarshalMsg added in v0.73.0

func (sl *SpanLink) MarshalMsg(bts []byte, strings *StringTable, serStrings *SerializedStrings) (o []byte, err error)

MarshalMsg marshals a SpanLink into a byte stream

func (*SpanLink) Msgsize added in v0.73.0

func (sl *SpanLink) Msgsize() int

Msgsize returns the size of the message when serialized.

func (*SpanLink) ProtoMessage

func (*SpanLink) ProtoMessage()

func (*SpanLink) ProtoReflect

func (x *SpanLink) ProtoReflect() protoreflect.Message

func (*SpanLink) Reset

func (x *SpanLink) Reset()

func (*SpanLink) String

func (x *SpanLink) String() string

func (*SpanLink) UnmarshalMsg added in v0.73.0

func (sl *SpanLink) UnmarshalMsg(bts []byte, strings *StringTable) (o []byte, err error)

UnmarshalMsg unmarshals a SpanLink from a byte stream, updating the strings slice with new strings

type StringTable

type StringTable struct {
	// contains filtered or unexported fields
}

StringTable is a table of strings that is used to store the de-duplicated strings in a trace Strings are not garbage collected automatically, so it is important to call RemoveUnusedStrings on the tracer payload to remove any strings that are no longer referenced.

func NewStringTable

func NewStringTable() *StringTable

NewStringTable creates a new string table, always starts with an empty string at index 0

func NewStringTableWithCapacity added in v0.76.0

func NewStringTableWithCapacity(capacity int) *StringTable

NewStringTable creates a new string table, always starts with an empty string at index 0

func StringTableFromArray added in v0.73.0

func StringTableFromArray(strings []string) *StringTable

StringTableFromArray creates a new string table from an array of already de-duplicated strings, the first string must always be the empty string

func (*StringTable) Add

func (s *StringTable) Add(str string) uint32

Add adds a string to the string table if it doesn't already exist and returns the index of the string

func (*StringTable) Clone added in v0.73.0

func (s *StringTable) Clone() *StringTable

Clone creates a deep copy of the string table.

func (*StringTable) Get

func (s *StringTable) Get(idx uint32) string

Get returns the string at the given index - panics if out of bounds

func (*StringTable) Len

func (s *StringTable) Len() int

Len returns the number of strings in the string table

func (*StringTable) Lookup added in v0.73.0

func (s *StringTable) Lookup(str string) uint32

Lookup returns the index of the string in the string table, or 0 if the string is not found

func (*StringTable) Msgsize added in v0.73.0

func (s *StringTable) Msgsize() int

Msgsize returns the size of the message when serialized.

type TraceChunk

type TraceChunk struct {

	// priority specifies the string table ref of the sampling priority of the trace.
	Priority int32 `protobuf:"varint,1,opt,name=priority,proto3" json:"priority,omitempty"`
	// originRef specifies the string table ref of the origin product ("lambda", "rum", etc.) of the trace.
	OriginRef uint32 `protobuf:"varint,2,opt,name=originRef,proto3" json:"originRef,omitempty"`
	// attributes specifies the map of string table ref to AnyValue of the tags common in all `spans`.
	Attributes map[uint32]*AnyValue `` /* 148-byte string literal not displayed */
	// spans specifies list of containing spans.
	Spans []*Span `protobuf:"bytes,4,rep,name=spans,proto3" json:"spans,omitempty"`
	// droppedTrace specifies whether the trace was dropped by samplers or not.
	DroppedTrace bool `protobuf:"varint,5,opt,name=droppedTrace,proto3" json:"droppedTrace,omitempty"`
	// traceID specifies the ID of the trace to which all spans in this chunk belong.
	TraceID []byte `protobuf:"bytes,6,opt,name=traceID,proto3" json:"traceID,omitempty"`
	// samplingMechanism specifies the optional sampling mechanism (previously part of span tag _dd.p.dm)
	SamplingMechanism uint32 `protobuf:"varint,7,opt,name=samplingMechanism,proto3" json:"samplingMechanism,omitempty"`
	// contains filtered or unexported fields
}

TraceChunk represents a list of spans with the same trace ID. In other words, a chunk of a trace.

func (*TraceChunk) Descriptor deprecated

func (*TraceChunk) Descriptor() ([]byte, []int)

Deprecated: Use TraceChunk.ProtoReflect.Descriptor instead.

func (*TraceChunk) GetAttributes

func (x *TraceChunk) GetAttributes() map[uint32]*AnyValue

func (*TraceChunk) GetDroppedTrace

func (x *TraceChunk) GetDroppedTrace() bool

func (*TraceChunk) GetOriginRef

func (x *TraceChunk) GetOriginRef() uint32

func (*TraceChunk) GetPriority

func (x *TraceChunk) GetPriority() int32

func (*TraceChunk) GetSamplingMechanism added in v0.72.0

func (x *TraceChunk) GetSamplingMechanism() uint32

func (*TraceChunk) GetSpans

func (x *TraceChunk) GetSpans() []*Span

func (*TraceChunk) GetTraceID

func (x *TraceChunk) GetTraceID() []byte

func (*TraceChunk) ProtoMessage

func (*TraceChunk) ProtoMessage()

func (*TraceChunk) ProtoReflect

func (x *TraceChunk) ProtoReflect() protoreflect.Message

func (*TraceChunk) Reset

func (x *TraceChunk) Reset()

func (*TraceChunk) String

func (x *TraceChunk) String() string

type TracerPayload

type TracerPayload struct {

	// strings specifies the array of strings referenced in this tracer payload, its chunks and spans.
	Strings []string `protobuf:"bytes,1,rep,name=strings,proto3" json:"strings,omitempty"`
	// containerIDRef specifies the string table ref of the ID of the container where the tracer is running on.
	ContainerIDRef uint32 `protobuf:"varint,2,opt,name=containerIDRef,proto3" json:"containerIDRef,omitempty"`
	// languageNameRef specifies the string table ref of the language of the tracer.
	LanguageNameRef uint32 `protobuf:"varint,3,opt,name=languageNameRef,proto3" json:"languageNameRef,omitempty"`
	// languageVersionRef specifies the string table ref of the language version of the tracer.
	LanguageVersionRef uint32 `protobuf:"varint,4,opt,name=languageVersionRef,proto3" json:"languageVersionRef,omitempty"`
	// tracerVersionRef specifies the string table ref of the version of the tracer.
	TracerVersionRef uint32 `protobuf:"varint,5,opt,name=tracerVersionRef,proto3" json:"tracerVersionRef,omitempty"`
	// runtimeIDRef specifies the string table ref of the V4 UUID representation of a tracer session.
	RuntimeIDRef uint32 `protobuf:"varint,6,opt,name=runtimeIDRef,proto3" json:"runtimeIDRef,omitempty"`
	// envRef specifies the string table ref of the `env` tag that set with the tracer.
	EnvRef uint32 `protobuf:"varint,7,opt,name=envRef,proto3" json:"envRef,omitempty"`
	// hostnameRef specifies the string table ref of the hostname of where the tracer is running.
	HostnameRef uint32 `protobuf:"varint,8,opt,name=hostnameRef,proto3" json:"hostnameRef,omitempty"`
	// appVersionRef specifies the string table ref of the `version` tag set in the tracer.
	AppVersionRef uint32 `protobuf:"varint,9,opt,name=appVersionRef,proto3" json:"appVersionRef,omitempty"`
	// a collection of key to value pairs common in all `chunks`
	Attributes map[uint32]*AnyValue `` /* 149-byte string literal not displayed */
	// chunks specifies list of containing trace chunks.
	Chunks []*TraceChunk `protobuf:"bytes,11,rep,name=chunks,proto3" json:"chunks,omitempty"`
	// contains filtered or unexported fields
}

TracerPayload represents a payload the trace agent receives from tracers.

func (*TracerPayload) CompactStrings added in v0.76.0

func (x *TracerPayload) CompactStrings()

CompactStrings compacts the string table by removing unused strings and remapping all references. Unlike RemoveUnusedStrings which just zeros unused strings, this function creates a new smaller string table and updates all references throughout the payload to point to the new indices. This produces a more compact serialized representation.

func (*TracerPayload) Descriptor deprecated

func (*TracerPayload) Descriptor() ([]byte, []int)

Deprecated: Use TracerPayload.ProtoReflect.Descriptor instead.

func (*TracerPayload) GetAppVersionRef added in v0.72.0

func (x *TracerPayload) GetAppVersionRef() uint32

func (*TracerPayload) GetAttributes

func (x *TracerPayload) GetAttributes() map[uint32]*AnyValue

func (*TracerPayload) GetChunks

func (x *TracerPayload) GetChunks() []*TraceChunk

func (*TracerPayload) GetContainerIDRef

func (x *TracerPayload) GetContainerIDRef() uint32

func (*TracerPayload) GetEnvRef

func (x *TracerPayload) GetEnvRef() uint32

func (*TracerPayload) GetHostnameRef

func (x *TracerPayload) GetHostnameRef() uint32

func (*TracerPayload) GetLanguageNameRef

func (x *TracerPayload) GetLanguageNameRef() uint32

func (*TracerPayload) GetLanguageVersionRef

func (x *TracerPayload) GetLanguageVersionRef() uint32

func (*TracerPayload) GetRuntimeIDRef

func (x *TracerPayload) GetRuntimeIDRef() uint32

func (*TracerPayload) GetStrings

func (x *TracerPayload) GetStrings() []string

func (*TracerPayload) GetTracerVersionRef

func (x *TracerPayload) GetTracerVersionRef() uint32

func (*TracerPayload) NewStringsClone added in v0.76.0

func (x *TracerPayload) NewStringsClone() *TracerPayload

NewStringsClone returns a shallow copy of the tracer payload. where the strings are set to a new string table. This can be used to split a payload into multiple payloads and remove unused strings from the new payloads without modifying the original payload.

func (*TracerPayload) ProtoMessage

func (*TracerPayload) ProtoMessage()

func (*TracerPayload) ProtoReflect

func (x *TracerPayload) ProtoReflect() protoreflect.Message

func (*TracerPayload) RemoveUnusedStrings added in v0.76.0

func (x *TracerPayload) RemoveUnusedStrings()

RemoveUnusedStrings removes any strings from the string table that are not referenced in the tracer payload This should be called before serializing or otherwise exposing the tracer payload to remove any sensitive strings that are no longer referenced

func (*TracerPayload) Reset

func (x *TracerPayload) Reset()

func (*TracerPayload) String

func (x *TracerPayload) String() string

Jump to

Keyboard shortcuts

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