otelreceiver

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package otelreceiver provides simple wrapper to setup trace receiver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumers

type Consumers struct {
	Traces  TracesConsumer
	Metrics MetricsConsumer
	Logs    LogsConsumer
}

Consumers is a set of telemetry consumers.

type LogsConsumer

type LogsConsumer interface {
	ConsumeLogs(ctx context.Context, ld plog.Logs) error
}

LogsConsumer is logs consumer.

type MetricsConsumer

type MetricsConsumer interface {
	ConsumeMetrics(ctx context.Context, ld pmetric.Metrics) error
}

MetricsConsumer is metrics consumer.

type Receiver

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

Receiver is a OpenTelemetry-compatible trace receiver.

func NewReceiver

func NewReceiver(consumers Consumers, cfg ReceiverConfig) (*Receiver, error)

NewReceiver setups trace receiver.

func (*Receiver) GetExporters

func (r *Receiver) GetExporters() map[component.DataType]map[component.ID]component.Component

GetExporters implements component.Host

func (*Receiver) GetExtensions

func (r *Receiver) GetExtensions() map[component.ID]extension.Extension

GetExtensions implements component.Host

func (*Receiver) GetFactory

GetFactory implements component.Host

func (*Receiver) ReportFatalError

func (r *Receiver) ReportFatalError(err error)

ReportFatalError implements component.Host

func (*Receiver) Run

func (r *Receiver) Run(ctx context.Context) (rerr error)

Run setups corresponding listeners.

type ReceiverConfig

type ReceiverConfig struct {
	OTELConfig     map[string]any
	TracerProvider trace.TracerProvider
	MeterProvider  metric.MeterProvider
	Logger         *zap.Logger
}

ReceiverConfig is a config struct for Receiver.

type TracesConsumer

type TracesConsumer interface {
	ConsumeTraces(ctx context.Context, td ptrace.Traces) error
}

TracesConsumer is traces consumer.

Directories

Path Synopsis
Package prometheusremotewrite contains translator from Prometheus remote write format to OTLP metrics.
Package prometheusremotewrite contains translator from Prometheus remote write format to OTLP metrics.
Package prometheusremotewritereceiver implements Prometheus Remote Write API for OTLP collector.
Package prometheusremotewritereceiver implements Prometheus Remote Write API for OTLP collector.

Jump to

Keyboard shortcuts

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