otlp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 15 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 Attributes16StoreFrom

func Attributes16StoreFrom(record arrow.Record, store *Attributes16Store) error

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

func Attributes32StoreFrom(record arrow.Record, store *Attributes32Store) error

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

func AttributesId

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

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 *Attributes16Store) (schemaUrl string, err error)

func UpdateScopeFromRecord

func UpdateScopeFromRecord(
	s pcommon.InstrumentationScope,
	record arrow.Record,
	row int,
	ids *ScopeIds,
	attrsStore *Attributes16Store,
) 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 Attributes16Store

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

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

func NewAttributes16Store() *Attributes16Store

NewAttributes16Store creates a new Attributes16Store.

func (*Attributes16Store) AttributesByDeltaID

func (s *Attributes16Store) AttributesByDeltaID(ID uint16) *pcommon.Map

AttributesByDeltaID returns the attributes for the given Delta ID.

func (*Attributes16Store) AttributesByID

func (s *Attributes16Store) AttributesByID(ID uint16) *pcommon.Map

AttributesByID returns the attributes for the given ID.

type Attributes32Store

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

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

func NewAttributes32Store() *Attributes32Store

NewAttributes32Store creates a new Attributes32Store.

func (*Attributes32Store) AttributesByDeltaID

func (s *Attributes32Store) AttributesByDeltaID(ID uint32) *pcommon.Map

AttributesByDeltaID returns the attributes for the given Delta ID.

func (*Attributes32Store) AttributesByID

func (s *Attributes32Store) AttributesByID(ID uint32) *pcommon.Map

AttributesByID returns the attributes for the given ID.

type Attrs16ParentIdDecoder

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

func NewAttrs16ParentIdDecoder

func NewAttrs16ParentIdDecoder() *Attrs16ParentIdDecoder

func (*Attrs16ParentIdDecoder) Decode

func (d *Attrs16ParentIdDecoder) Decode(deltaOrParentID uint16, key string, value *pcommon.Value) uint16

type Attrs32ParentIdDecoder

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

func NewAttrs32ParentIdDecoder

func NewAttrs32ParentIdDecoder() *Attrs32ParentIdDecoder

func (*Attrs32ParentIdDecoder) Decode

func (d *Attrs32ParentIdDecoder) Decode(deltaOrParentID uint32, key string, value *pcommon.Value) uint32

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