processorhelper

package
v0.0.0-...-76a0d45 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipProcessingData = errors.New("sentinel error to skip processing data from the remainder of the pipeline")

ErrSkipProcessingData is a sentinel value to indicate when traces or metrics should intentionally be dropped from further processing in the pipeline because the data is determined to be irrelevant. A processor can return this error to stop further processing without propagating an error back up the pipeline to logs.

Functions

func BuildCustomMetricName

func BuildCustomMetricName(configType, metric string) string

BuildCustomMetricName is used to be build a metric name following the standards used in the Collector. The configType should be the same value used to identify the type on the config.

func NewLogsProcessor

func NewLogsProcessor(
	_ context.Context,
	set processor.CreateSettings,
	_ component.Config,
	nextConsumer consumer.Logs,
	logsFunc ProcessLogsFunc,
	options ...Option,
) (processor.Logs, error)

NewLogsProcessor creates a processor.Logs that ensure context propagation and the right tags are set.

func NewMetricsProcessor

func NewMetricsProcessor(
	_ context.Context,
	set processor.CreateSettings,
	_ component.Config,
	nextConsumer consumer.Metrics,
	metricsFunc ProcessMetricsFunc,
	options ...Option,
) (processor.Metrics, error)

NewMetricsProcessor creates a processor.Metrics that ensure context propagation and the right tags are set.

func NewTracesProcessor

func NewTracesProcessor(
	_ context.Context,
	set processor.CreateSettings,
	_ component.Config,
	nextConsumer consumer.Traces,
	tracesFunc ProcessTracesFunc,
	options ...Option,
) (processor.Traces, error)

NewTracesProcessor creates a processor.Traces that ensure context propagation and the right tags are set.

Types

type ObsReport

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

ObsReport is a helper to add observability to a processor.

func NewObsReport

func NewObsReport(cfg ObsReportSettings) (*ObsReport, error)

NewObsReport creates a new Processor.

func (*ObsReport) LogsAccepted

func (or *ObsReport) LogsAccepted(ctx context.Context, numRecords int)

LogsAccepted reports that the logs were accepted.

func (*ObsReport) LogsDropped

func (or *ObsReport) LogsDropped(ctx context.Context, numRecords int)

LogsDropped reports that the logs were dropped.

func (*ObsReport) LogsRefused

func (or *ObsReport) LogsRefused(ctx context.Context, numRecords int)

LogsRefused reports that the logs were refused.

func (*ObsReport) MetricsAccepted

func (or *ObsReport) MetricsAccepted(ctx context.Context, numPoints int)

MetricsAccepted reports that the metrics were accepted.

func (*ObsReport) MetricsDropped

func (or *ObsReport) MetricsDropped(ctx context.Context, numPoints int)

MetricsDropped reports that the metrics were dropped.

func (*ObsReport) MetricsRefused

func (or *ObsReport) MetricsRefused(ctx context.Context, numPoints int)

MetricsRefused reports that the metrics were refused.

func (*ObsReport) TracesAccepted

func (or *ObsReport) TracesAccepted(ctx context.Context, numSpans int)

TracesAccepted reports that the trace data was accepted.

func (*ObsReport) TracesDropped

func (or *ObsReport) TracesDropped(ctx context.Context, numSpans int)

TracesDropped reports that the trace data was dropped.

func (*ObsReport) TracesRefused

func (or *ObsReport) TracesRefused(ctx context.Context, numSpans int)

TracesRefused reports that the trace data was refused.

type ObsReportSettings

type ObsReportSettings struct {
	ProcessorID             component.ID
	ProcessorCreateSettings processor.CreateSettings
}

ObsReportSettings are settings for creating an ObsReport.

type Option

type Option func(*baseSettings)

Option apply changes to internalOptions.

func WithCapabilities

func WithCapabilities(capabilities consumer.Capabilities) Option

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

func WithShutdown

func WithShutdown(shutdown component.ShutdownFunc) Option

WithShutdown overrides the default Shutdown function for an processor. The default shutdown function does nothing and always returns nil.

func WithStart

func WithStart(start component.StartFunc) Option

WithStart overrides the default Start function for an processor. The default shutdown function does nothing and always returns nil.

type ProcessLogsFunc

type ProcessLogsFunc func(context.Context, plog.Logs) (plog.Logs, error)

ProcessLogsFunc is a helper function that processes the incoming data and returns the data to be sent to the next component. If error is returned then returned data are ignored. It MUST not call the next component.

type ProcessMetricsFunc

type ProcessMetricsFunc func(context.Context, pmetric.Metrics) (pmetric.Metrics, error)

ProcessMetricsFunc is a helper function that processes the incoming data and returns the data to be sent to the next component. If error is returned then returned data are ignored. It MUST not call the next component.

type ProcessTracesFunc

type ProcessTracesFunc func(context.Context, ptrace.Traces) (ptrace.Traces, error)

ProcessTracesFunc is a helper function that processes the incoming data and returns the data to be sent to the next component. If error is returned then returned data are ignored. It MUST not call the next component.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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