otlp

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package otlp contains types and functions used to convert OTLP Arrow traces into their OTLP representation.

Index

Constants

View Source
const None = -1

Variables

This section is empty.

Functions

func TracesFrom

func TracesFrom(record arrow.Record, relatedData *RelatedData) (ptrace.Traces, error)

TracesFrom creates a ptrace.Traces from the given Arrow Record.

Important Note: This function doesn't take ownership of the record, so the record must be released by the caller.

Types

type EventParentIdDecoder

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

func NewEventParentIdDecoder

func NewEventParentIdDecoder(encodingType int) *EventParentIdDecoder

func (*EventParentIdDecoder) Decode

func (d *EventParentIdDecoder) Decode(value uint16, name string) uint16

type LinkParentIdDecoder

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

func NewLinkParentIdDecoder

func NewLinkParentIdDecoder(encodingType int) *LinkParentIdDecoder

func (*LinkParentIdDecoder) Decode

func (d *LinkParentIdDecoder) Decode(value uint16, traceID []byte) uint16

type RelatedData

type RelatedData struct {
	SpanID                uint16
	ResAttrMapStore       *otlp.Attributes16Store
	ScopeAttrMapStore     *otlp.Attributes16Store
	SpanAttrMapStore      *otlp.Attributes16Store
	SpanEventAttrMapStore *otlp.Attributes32Store
	SpanLinkAttrMapStore  *otlp.Attributes32Store
	SpanEventsStore       *SpanEventsStore
	SpanLinksStore        *SpanLinksStore
}

func NewRelatedData

func NewRelatedData(conf *arrow.Config) *RelatedData

func RelatedDataFrom

func RelatedDataFrom(records []*record_message.RecordMessage, conf *arrow.Config) (relatedData *RelatedData, tracesRecord *record_message.RecordMessage, err error)

func (*RelatedData) SpanIDFromDelta

func (r *RelatedData) SpanIDFromDelta(delta uint16) uint16

type SpanEventIDs

type SpanEventIDs struct {
	ParentID               int // Span ID
	TimeUnixNano           int
	Name                   int
	ID                     int // Event ID (used by attributes of the event)
	DroppedAttributesCount int
}

SpanEventIDs is a struct containing the Arrow field IDs for the Event struct.

func SchemaToSpanEventIDs

func SchemaToSpanEventIDs(schema *arrow.Schema) (*SpanEventIDs, error)

SchemaToSpanEventIDs pre-computes the field IDs for the events record.

type SpanEventsStore

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

SpanEventsStore contains a set of events indexed by span ID. This store is initialized from an arrow.Record representing all the events for a batch of spans.

func NewSpanEventsStore

func NewSpanEventsStore(config *tarrow.EventConfig) *SpanEventsStore

NewSpanEventsStore creates a new SpanEventsStore.

func SpanEventsStoreFrom

func SpanEventsStoreFrom(
	record arrow.Record,
	attrsStore *otlp.Attributes32Store,
	conf *tarrow.EventConfig,
) (*SpanEventsStore, error)

SpanEventsStoreFrom creates an SpanEventsStore from an arrow.Record.

Important Note: This function doesn't take ownership of the record. The caller is responsible for releasing it.

func (*SpanEventsStore) EventsByID

func (s *SpanEventsStore) EventsByID(ID uint16) []*ptrace.SpanEvent

EventsByID returns the events for the given span ID.

type SpanIDs

type SpanIDs struct {
	ID                   int // Numerical ID of the current span
	Resource             *otlp.ResourceIds
	Scope                *otlp.ScopeIds
	SchemaUrl            int
	StartTimeUnixNano    int
	DurationTimeUnixNano int
	TraceID              int
	SpanID               int
	TraceState           int
	ParentSpanID         int
	Name                 int
	Kind                 int
	DropAttributesCount  int
	DropEventsCount      int
	DropLinksCount       int
	Status               *StatusIDs
}

SpanIDs contains the field IDs for the span schema.

func SchemaToIds

func SchemaToIds(schema *arrow.Schema) (*SpanIDs, error)

type SpanLinkIDs

type SpanLinkIDs struct {
	ID                     int
	ParentID               int
	TraceID                int
	SpanID                 int
	TraceState             int
	DroppedAttributesCount int
}

SpanLinkIDs is a struct containing the Arrow field IDs for the Link struct.

func SchemaToSpanLinkIDs

func SchemaToSpanLinkIDs(schema *arrow.Schema) (*SpanLinkIDs, error)

SchemaToSpanLinkIDs pre-computes the field IDs for the links record.

type SpanLinksStore

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

SpanLinksStore contains a set of links indexed by span ID. This store is initialized from an arrow.Record representing all the links for a batch of spans.

func NewSpanLinksStore

func NewSpanLinksStore() *SpanLinksStore

NewSpanLinksStore creates a new SpanLinksStore.

func SpanLinksStoreFrom

func SpanLinksStoreFrom(
	record arrow.Record,
	attrsStore *otlp.Attributes32Store,
	conf *tarrow.LinkConfig,
) (*SpanLinksStore, error)

SpanLinksStoreFrom creates an SpanLinksStore from an arrow.Record.

Important Note: This function doesn't take ownership of the record. The caller is responsible for releasing it.

func (*SpanLinksStore) LinksByID

func (s *SpanLinksStore) LinksByID(ID uint16) []*ptrace.SpanLink

LinksByID returns the links for the given ID.

type StatusIDs

type StatusIDs struct {
	Status  int
	Code    int
	Message int
}

StatusIDs contains the field IDs for the status Arrow struct.

func NewStatusIdsFromSchema

func NewStatusIdsFromSchema(schema *arrow.Schema) (*StatusIDs, error)

Jump to

Keyboard shortcuts

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