otlp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	UndefinedTypeValue = 0
	IntValue           = 1
	DoubleValue        = 2
)
View Source
const None = -1

Variables

View Source
var (
	ErrNotArrayInt32   = errors.New("not an arrow array.Int32")
	ErrNotArrayUint64  = errors.New("not an arrow array.Uint64")
	ErrNotArrayFloat64 = errors.New("not an arrow array.Float64")
	ErrNotArrayList    = errors.New("not an arrow array.List")
)

Functions

func AppendQuantileValuesInto

func AppendQuantileValuesInto(quantileSlice pmetric.SummaryDataPointValueAtQuantileSlice, record arrow.Record, ndpIdx int, ids *QuantileValueIds) error

func AppendUnivariateEHistogramDataPointBucketsInto

func AppendUnivariateEHistogramDataPointBucketsInto(dpBuckets pmetric.ExponentialHistogramDataPointBuckets, ehdp *array.Struct, ids *EHistogramDataPointBucketsIds, row int) error

func MetricsFrom

func MetricsFrom(record arrow.Record, relatedData *RelatedData) (pmetric.Metrics, error)

MetricsFrom creates a pmetric.Metrics from the given Arrow Record.

Types

type EHistogramDataPointBucketsIds

type EHistogramDataPointBucketsIds struct {
	ID           int
	Offset       int
	BucketCounts int
}

func NewEHistogramDataPointBucketsIds

func NewEHistogramDataPointBucketsIds(schema *arrow.Schema, parent string) (*EHistogramDataPointBucketsIds, error)

type EHistogramDataPointIDs

type EHistogramDataPointIDs struct {
	ID                int
	ParentID          int
	StartTimeUnixNano int
	TimeUnixNano      int
	Count             int
	Sum               int
	Scale             int
	ZeroCount         int
	Positive          *EHistogramDataPointBucketsIds
	Negative          *EHistogramDataPointBucketsIds
	Flags             int
	Min               int
	Max               int
}

func SchemaToEHistogramIDs

func SchemaToEHistogramIDs(schema *arrow.Schema) (*EHistogramDataPointIDs, error)

type EHistogramDataPointsStore

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

func EHistogramDataPointsStoreFrom

func EHistogramDataPointsStoreFrom(record arrow.Record, exemplarsStore *ExemplarsStore, attrsStore *otlp.Attributes32Store) (*EHistogramDataPointsStore, error)

func NewEHistogramDataPointsStore

func NewEHistogramDataPointsStore() *EHistogramDataPointsStore

func (*EHistogramDataPointsStore) EHistogramMetricsByID

type ExemplarIDs

type ExemplarIDs struct {
	ID           int
	ParentID     int
	TimeUnixNano int
	SpanID       int
	TraceID      int
	IntValue     int
	DoubleValue  int
}

ExemplarIDs contains the field IDs for the exemplar struct.

func SchemaToExemplarIDs

func SchemaToExemplarIDs(schema *arrow.Schema) (*ExemplarIDs, error)

type ExemplarParentIdDecoder

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

func NewExemplarParentIdDecoder

func NewExemplarParentIdDecoder(encodingType int) *ExemplarParentIdDecoder

func (*ExemplarParentIdDecoder) Decode

func (d *ExemplarParentIdDecoder) Decode(value uint32, intValue *int64, doubleValue *float64) uint32

type ExemplarsStore

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

func ExemplarsStoreFrom

func ExemplarsStoreFrom(
	record arrow.Record,
	attrsStore *otlp.Attributes32Store,
) (*ExemplarsStore, error)

ExemplarsStoreFrom creates an ExemplarsStore from an arrow.Record. Note: This function consume the record.

func NewExemplarsStore

func NewExemplarsStore() *ExemplarsStore

func (*ExemplarsStore) ExemplarsByID

func (s *ExemplarsStore) ExemplarsByID(ID uint32) pmetric.ExemplarSlice

type HistogramDataPointIDs

type HistogramDataPointIDs struct {
	ID                int
	ParentID          int
	StartTimeUnixNano int
	TimeUnixNano      int
	Count             int
	Sum               int
	BucketCounts      int // List of uint64
	ExplicitBounds    int // List of float64
	Flags             int
	Min               int
	Max               int
}

func SchemaToHistogramIDs

func SchemaToHistogramIDs(schema *arrow.Schema) (*HistogramDataPointIDs, error)

type HistogramDataPointsStore

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

func HistogramDataPointsStoreFrom

func HistogramDataPointsStoreFrom(record arrow.Record, exemplarsStore *ExemplarsStore, attrsStore *otlp.Attributes32Store) (*HistogramDataPointsStore, error)

func NewHistogramDataPointsStore

func NewHistogramDataPointsStore() *HistogramDataPointsStore

func (*HistogramDataPointsStore) HistogramMetricsByID

func (s *HistogramDataPointsStore) HistogramMetricsByID(ID uint16) pmetric.HistogramDataPointSlice

type MetricsIds

type MetricsIds struct {
	ID                     int // Numerical ID of the current span
	Resource               *otlp.ResourceIds
	Scope                  *otlp.ScopeIds
	SchemaUrl              int
	MetricType             int
	Name                   int
	Description            int
	Unit                   int
	AggregationTemporality int
	IsMonotonic            int
}

MetricsIds contains the IDs of the fields in the Arrow Record.

func SchemaToIds

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

type NumberDataPointIDs

type NumberDataPointIDs struct {
	ID                int
	ParentID          int
	StartTimeUnixNano int
	TimeUnixNano      int
	IntValue          int
	DoubleValue       int
	Flags             int
}

func SchemaToNDPIDs

func SchemaToNDPIDs(schema *arrow.Schema) (*NumberDataPointIDs, error)

type NumberDataPointsStore

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

func NewNumberDataPointsStore

func NewNumberDataPointsStore() *NumberDataPointsStore

func NumberDataPointsStoreFrom

func NumberDataPointsStoreFrom(record arrow.Record, exemplarsStore *ExemplarsStore, attrsStore *otlp.Attributes32Store) (*NumberDataPointsStore, error)

func (*NumberDataPointsStore) NumberDataPointsByID

func (s *NumberDataPointsStore) NumberDataPointsByID(ID uint16) pmetric.NumberDataPointSlice

type QuantileValueIds

type QuantileValueIds struct {
	Id       int
	Quantile int
	Value    int
}

func NewQuantileValueIds

func NewQuantileValueIds(schema *arrow.Schema) (*QuantileValueIds, error)

type RelatedData

type RelatedData struct {
	MetricID uint16

	// Attributes stores
	ResAttrMapStore                *otlp.Attributes16Store
	ScopeAttrMapStore              *otlp.Attributes16Store
	NumberDPAttrsStore             *otlp.Attributes32Store
	SummaryAttrsStore              *otlp.Attributes32Store
	HistogramAttrsStore            *otlp.Attributes32Store
	ExpHistogramAttrsStore         *otlp.Attributes32Store
	NumberDPExemplarAttrsStore     *otlp.Attributes32Store
	HistogramExemplarAttrsStore    *otlp.Attributes32Store
	ExpHistogramExemplarAttrsStore *otlp.Attributes32Store

	// Metric stores
	NumberDataPointsStore     *NumberDataPointsStore
	SummaryDataPointsStore    *SummaryDataPointsStore
	HistogramDataPointsStore  *HistogramDataPointsStore
	EHistogramDataPointsStore *EHistogramDataPointsStore

	// Exemplar stores
	NumberDataPointExemplarsStore     *ExemplarsStore
	HistogramDataPointExemplarsStore  *ExemplarsStore
	EHistogramDataPointExemplarsStore *ExemplarsStore
}

func NewRelatedData

func NewRelatedData() *RelatedData

func RelatedDataFrom

func RelatedDataFrom(records []*record_message.RecordMessage) (relatedData *RelatedData, metricsRecord *record_message.RecordMessage, err error)

func (*RelatedData) MetricIDFromDelta

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

type SummaryDataPointIDs

type SummaryDataPointIDs struct {
	ID                int
	ParentID          int
	StartTimeUnixNano int
	TimeUnixNano      int
	Count             int
	Sum               int
	QuantileValues    *QuantileValueIds
	Flags             int
}

func SchemaToSummaryIDs

func SchemaToSummaryIDs(schema *arrow.Schema) (*SummaryDataPointIDs, error)

type SummaryDataPointsStore

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

func NewSummaryDataPointsStore

func NewSummaryDataPointsStore() *SummaryDataPointsStore

func SummaryDataPointsStoreFrom

func SummaryDataPointsStoreFrom(record arrow.Record, attrsStore *otlp.Attributes32Store) (*SummaryDataPointsStore, error)

func (*SummaryDataPointsStore) SummaryMetricsByID

func (s *SummaryDataPointsStore) SummaryMetricsByID(ID uint16) pmetric.SummaryDataPointSlice

Jump to

Keyboard shortcuts

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