consumer

package module
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 6 Imported by: 1,131

Documentation

Overview

Package consumer contains interfaces that receive and process data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities = internal.Capabilities

Capabilities describes the capabilities of a Processor.

type ConsumeLogsFunc

type ConsumeLogsFunc func(ctx context.Context, ld plog.Logs) error

ConsumeLogsFunc is a helper function that is similar to ConsumeLogs.

func (ConsumeLogsFunc) ConsumeLogs

func (f ConsumeLogsFunc) ConsumeLogs(ctx context.Context, ld plog.Logs) error

ConsumeLogs calls f(ctx, ld).

type ConsumeMetricsFunc

type ConsumeMetricsFunc func(ctx context.Context, md pmetric.Metrics) error

ConsumeMetricsFunc is a helper function that is similar to ConsumeMetrics.

func (ConsumeMetricsFunc) ConsumeMetrics

func (f ConsumeMetricsFunc) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error

ConsumeMetrics calls f(ctx, md).

type ConsumeTracesFunc

type ConsumeTracesFunc func(ctx context.Context, td ptrace.Traces) error

ConsumeTracesFunc is a helper function that is similar to ConsumeTraces.

func (ConsumeTracesFunc) ConsumeTraces

func (f ConsumeTracesFunc) ConsumeTraces(ctx context.Context, td ptrace.Traces) error

ConsumeTraces calls f(ctx, td).

type Logs

type Logs interface {
	internal.BaseConsumer
	// ConsumeLogs processes the logs. After the function returns, the logs are no longer accessible,
	// and accessing them is considered undefined behavior.
	ConsumeLogs(ctx context.Context, ld plog.Logs) error
}

Logs is an interface that receives plog.Logs, processes it as needed, and sends it to the next processing node if any or to the destination.

func NewLogs

func NewLogs(consume ConsumeLogsFunc, options ...Option) (Logs, error)

NewLogs returns a Logs configured with the provided options.

type Metrics

type Metrics interface {
	internal.BaseConsumer
	// ConsumeMetrics processes the metrics. After the function returns, the metrics are no longer accessible,
	// and accessing them is considered undefined behavior.
	ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error
}

Metrics is an interface that receives pmetric.Metrics, processes it as needed, and sends it to the next processing node if any or to the destination.

func NewMetrics

func NewMetrics(consume ConsumeMetricsFunc, options ...Option) (Metrics, error)

NewMetrics returns a Metrics configured with the provided options.

type Option

type Option = internal.Option

Option to construct new consumers.

func WithCapabilities

func WithCapabilities(capabilities Capabilities) Option

WithCapabilities overrides the default GetCapabilities function for a processor. The default GetCapabilities function returns mutable capabilities.

type Traces

type Traces interface {
	internal.BaseConsumer
	// ConsumeTraces processes the traces. After the function returns, the traces are no longer accessible,
	// and accessing them is considered undefined behavior.
	ConsumeTraces(ctx context.Context, td ptrace.Traces) error
}

Traces is an interface that receives ptrace.Traces, processes it as needed, and sends it to the next processing node if any or to the destination.

func NewTraces

func NewTraces(consume ConsumeTracesFunc, options ...Option) (Traces, error)

NewTraces returns a Traces configured with the provided options.

Directories

Path Synopsis
consumererror module
consumertest module
xconsumer module

Jump to

Keyboard shortcuts

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