arrow_record

package
v0.0.0-...-cafc5b9 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 27 Imported by: 2

Documentation

Overview

Package arrow_record contains the consumer and producer for OTLP Arrow protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

Consumer is a BatchArrowRecords consumer.

func NewConsumer

func NewConsumer() *Consumer

NewConsumer creates a new BatchArrowRecords consumer, i.e. a decoder consuming BatchArrowRecords and returning the corresponding OTLP representation (pmetric,Metrics, plog.Logs, ptrace.Traces).

func (*Consumer) Close

func (c *Consumer) Close() error

Close closes the consumer and all its ipc readers.

func (*Consumer) Consume

Consume takes a BatchArrowRecords protobuf message and returns an array of RecordMessage. Note: the records wrapped in the RecordMessage must be released after use by the caller.

func (*Consumer) LogsFrom

func (c *Consumer) LogsFrom(bar *colarspb.BatchArrowRecords) ([]plog.Logs, error)

LogsFrom produces an array of plog.Logs from a BatchArrowRecords message.

func (*Consumer) MetricsFrom

func (c *Consumer) MetricsFrom(bar *colarspb.BatchArrowRecords) ([]pmetric.Metrics, error)

MetricsFrom produces an array of pmetric.Metrics from a BatchArrowRecords message.

func (*Consumer) TracesFrom

func (c *Consumer) TracesFrom(bar *colarspb.BatchArrowRecords) ([]ptrace.Traces, error)

TracesFrom produces an array of ptrace.Traces from a BatchArrowRecords message.

type ConsumerAPI

type ConsumerAPI interface {
	LogsFrom(*colarspb.BatchArrowRecords) ([]plog.Logs, error)
	TracesFrom(*colarspb.BatchArrowRecords) ([]ptrace.Traces, error)
	MetricsFrom(*colarspb.BatchArrowRecords) ([]pmetric.Metrics, error)
	Close() error
}

ConsumerAPI is the interface of a Consumer considering all signals. This is useful for mock testing.

type Producer

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

Producer is a BatchArrowRecords producer.

func NewProducer

func NewProducer() *Producer

NewProducer creates a new BatchArrowRecords producer.

The method close MUST be called when the producer is not used anymore to release the memory and avoid memory leaks.

func NewProducerWithOptions

func NewProducerWithOptions(options ...cfg.Option) *Producer

NewProducerWithOptions creates a new BatchArrowRecords producer with a set of options.

The method close MUST be called when the producer is not used anymore to release the memory and avoid memory leaks.

func (*Producer) BatchArrowRecordsFromLogs

func (p *Producer) BatchArrowRecordsFromLogs(ls plog.Logs) (*colarspb.BatchArrowRecords, error)

BatchArrowRecordsFromLogs produces a BatchArrowRecords message from a plog.Logs messages.

func (*Producer) BatchArrowRecordsFromMetrics

func (p *Producer) BatchArrowRecordsFromMetrics(metrics pmetric.Metrics) (*colarspb.BatchArrowRecords, error)

BatchArrowRecordsFromMetrics produces a BatchArrowRecords message from a pmetric.Metrics messages.

func (*Producer) BatchArrowRecordsFromTraces

func (p *Producer) BatchArrowRecordsFromTraces(ts ptrace.Traces) (*colarspb.BatchArrowRecords, error)

BatchArrowRecordsFromTraces produces a BatchArrowRecords message from a ptrace.Traces messages.

func (*Producer) Close

func (p *Producer) Close() error

Close closes all stream producers.

func (*Producer) GetAndResetStats

func (p *Producer) GetAndResetStats() pstats.ProducerStats

GetAndResetStats returns the stats and resets them.

func (*Producer) LogsBuilder

func (p *Producer) LogsBuilder() *logsarrow.LogsBuilder

func (*Producer) LogsRecordBuilderExt

func (p *Producer) LogsRecordBuilderExt() *builder.RecordBuilderExt

LogsRecordBuilderExt returns the record builder used to encode logs.

func (*Producer) MetricsBuilder

func (p *Producer) MetricsBuilder() *metricsarrow.MetricsBuilder

func (*Producer) MetricsRecordBuilderExt

func (p *Producer) MetricsRecordBuilderExt() *builder.RecordBuilderExt

MetricsRecordBuilderExt returns the record builder used to encode metrics.

func (*Producer) Produce

Produce takes a slice of RecordMessage and returns the corresponding BatchArrowRecords protobuf message.

func (*Producer) SetObserver

func (p *Producer) SetObserver(observer ProducerObserver)

SetObserver adds an observer to the producer.

func (*Producer) ShowStats

func (p *Producer) ShowStats()

func (*Producer) TracesBuilder

func (p *Producer) TracesBuilder() *tracesarrow.TracesBuilder

func (*Producer) TracesRecordBuilderExt

func (p *Producer) TracesRecordBuilderExt() *builder.RecordBuilderExt

TracesRecordBuilderExt returns the record builder used to encode traces.

type ProducerAPI

type ProducerAPI interface {
	BatchArrowRecordsFromTraces(ptrace.Traces) (*colarspb.BatchArrowRecords, error)
	BatchArrowRecordsFromLogs(plog.Logs) (*colarspb.BatchArrowRecords, error)
	BatchArrowRecordsFromMetrics(pmetric.Metrics) (*colarspb.BatchArrowRecords, error)
	Close() error
}

ProducerAPI is the interface of a Producer considering all signals. This is useful for mock testing.

type ProducerObserver

type ProducerObserver interface {
	OnRecord(arrow.Record, record_message.PayloadType)
}

Producer is a BatchArrowRecords producer.

func NewConsoleObserver

func NewConsoleObserver(maxRows, maxPrints int) ProducerObserver

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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