otlp

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingRelatedData  = errors.New("missing related data")
	ErrInvalidTypeCode     = errors.New("invalid type code")
	ErrInvalidFieldId      = errors.New("invalid field id")
	ErrParentIDMissing     = errors.New("parent id missing")
	ErrInvalidAttrName     = errors.New("invalid attribute name")
	ErrMissingTypeMetadata = errors.New("missing type metadata")
)

Functions

func AttributesId

func AttributesId(attrs pcommon.Map, b *strings.Builder)

func AttributesStoreFrom added in v0.32.0

func AttributesStoreFrom[unsigned constraints.Unsigned](record arrow.Record, store *AttributesStore[unsigned]) error

AttributesStoreFrom creates an Attribute16Store from an arrow.Record. Note: This function doesn't release the record passed as argument. This is the responsibility of the caller

func ResourceID

func ResourceID(r pcommon.Resource, schemaUrl string) string

func ResourceIDFromRecord

func ResourceIDFromRecord(record arrow.Record, row int, resIDs *ResourceIds) (uint16, error)

func ScopeID

func ScopeID(is pcommon.InstrumentationScope, schemaUrl string) string

func ScopeIDFromRecord

func ScopeIDFromRecord(record arrow.Record, row int, IDs *ScopeIds) (uint16, error)

func UpdateResourceFromRecord

func UpdateResourceFromRecord(r pcommon.Resource, record arrow.Record, row int, resIds *ResourceIds, attrsStore *AttributesStore[uint16]) (schemaUrl string, err error)

func UpdateScopeFromRecord

func UpdateScopeFromRecord(
	s pcommon.InstrumentationScope,
	record arrow.Record,
	row int,
	ids *ScopeIds,
	attrsStore *AttributesStore[uint16],
) error

func UpdateValueFrom

func UpdateValueFrom(v pcommon.Value, vArr *array.SparseUnion, row int) error

func ValueID

func ValueID(v pcommon.Value, b *strings.Builder)

Types

type AttributeFeeder

type AttributeFeeder interface {
	Update(record arrow.Record, row int, attrs pcommon.Map) (err error)
}

type AttributeIDs

type AttributeIDs struct {
	ParentID             int
	ParentIDDeltaEncoded bool
	Key                  int
	Type                 int
	Str                  int
	Int                  int
	Double               int
	Bool                 int
	Bytes                int
	Ser                  int
}

AttributeIDs is a struct containing the Arrow field IDs of the attributes.

func SchemaToAttributeIDs

func SchemaToAttributeIDs(schema *arrow.Schema) (*AttributeIDs, error)

SchemaToAttributeIDs pre-computes the field IDs for the attributes record.

type AttributesStore added in v0.32.0

type AttributesStore[u constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

AttributesStore is a store for attributes. The attributes are stored in a map by ID. This ID represents the identifier of the main entity (span, event, link, etc.) to which the attributes are attached. So the maximum number of attributes per entity is not limited.

func NewAttributesStore added in v0.32.0

func NewAttributesStore[u constraints.Unsigned]() *AttributesStore[u]

NewAttributesStore creates a new AttributesStore.

func (*AttributesStore[u]) AttributesByDeltaID added in v0.32.0

func (s *AttributesStore[u]) AttributesByDeltaID(ID u) *pcommon.Map

AttributesByDeltaID returns the attributes for the given Delta ID.

func (*AttributesStore[u]) AttributesByID added in v0.32.0

func (s *AttributesStore[u]) AttributesByID(ID u) *pcommon.Map

AttributesByID returns the attributes for the given ID.

type AttrsParentIDDecoder added in v0.32.0

type AttrsParentIDDecoder[u constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

func NewAttrsParentIDDecoder added in v0.32.0

func NewAttrsParentIDDecoder[u constraints.Unsigned]() *AttrsParentIDDecoder[u]

func (*AttrsParentIDDecoder[unsigned]) Decode added in v0.32.0

func (d *AttrsParentIDDecoder[unsigned]) Decode(deltaOrParentID unsigned, key string, value *pcommon.Value) unsigned

type BinaryAttributeFeeder

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

func (*BinaryAttributeFeeder) Update

func (f *BinaryAttributeFeeder) Update(record arrow.Record, row int, attrs pcommon.Map) (err error)

type BoolAttributeFeeder

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

func (*BoolAttributeFeeder) Update

func (f *BoolAttributeFeeder) Update(record arrow.Record, row int, attrs pcommon.Map) (err error)

type CborAttributeFeeder

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

func (*CborAttributeFeeder) Update

func (f *CborAttributeFeeder) Update(record arrow.Record, row int, attrs pcommon.Map) (err error)

type DoubleAttributeFeeder

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

func (*DoubleAttributeFeeder) Update

func (f *DoubleAttributeFeeder) Update(record arrow.Record, row int, attrs pcommon.Map) (err error)

type DynAttrsStore

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

func CreateDynAttrsStoreFrom

func CreateDynAttrsStoreFrom(record arrow.Record) (*DynAttrsStore, error)

func DynAttrsStoreFromRecord

func DynAttrsStoreFromRecord(record arrow.Record) (*DynAttrsStore, error)

func (*DynAttrsStore) Attributes

func (s *DynAttrsStore) Attributes(parentID uint32) (pcommon.Map, bool)

type IntAttributeFeeder

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

func (*IntAttributeFeeder) Update

func (f *IntAttributeFeeder) Update(record arrow.Record, row int, attrs pcommon.Map) (err error)

type ParentIDGetter

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

func (*ParentIDGetter) Get

func (g *ParentIDGetter) Get(record arrow.Record, row int) (parentID uint32, err error)

type ResourceIds

type ResourceIds struct {
	Resource               int
	ID                     int
	DroppedAttributesCount int
	SchemaUrl              int
}

func NewResourceIdsFromSchema

func NewResourceIdsFromSchema(schema *arrow.Schema) (*ResourceIds, error)

type ScopeIds

type ScopeIds struct {
	Scope                  int
	Name                   int
	Version                int
	ID                     int
	DroppedAttributesCount int
}

func NewScopeIdsFromSchema

func NewScopeIdsFromSchema(schema *arrow.Schema) (*ScopeIds, error)

type StringAttributeFeeder

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

func (*StringAttributeFeeder) Update

func (f *StringAttributeFeeder) Update(record arrow.Record, row int, attrs pcommon.Map) (err error)

Jump to

Keyboard shortcuts

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