testcomponents

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleExporterFactory = component.NewExporterFactory(
	typeStr,
	createExporterDefaultConfig,
	component.WithTracesExporter(createTracesExporter, stability),
	component.WithMetricsExporter(createMetricsExporter, stability),
	component.WithLogsExporter(createLogsExporter, stability),
)

ExampleExporterFactory is factory for ExampleExporter.

ExampleProcessorFactory is factory for ExampleProcessor.

View Source
var ExampleReceiverFactory = component.NewReceiverFactory(
	receiverType,
	createReceiverDefaultConfig,
	component.WithTracesReceiver(createTracesReceiver, component.StabilityLevelInDevelopment),
	component.WithMetricsReceiver(createMetricsReceiver, component.StabilityLevelInDevelopment),
	component.WithLogsReceiver(createLogsReceiver, component.StabilityLevelInDevelopment))

ExampleReceiverFactory is factory for ExampleReceiver.

Functions

func ExampleComponents

func ExampleComponents() (component.Factories, error)

ExampleComponents registers example factories. This is only used by tests.

Types

type ExampleExporter

type ExampleExporter struct {
	Traces  []ptrace.Traces
	Metrics []pmetric.Metrics
	Logs    []plog.Logs
	Started bool
	Stopped bool
}

ExampleExporter stores consumed traces and metrics for testing purposes.

func (*ExampleExporter) Capabilities added in v0.54.0

func (exp *ExampleExporter) Capabilities() consumer.Capabilities

func (*ExampleExporter) ConsumeLogs added in v0.54.0

func (exp *ExampleExporter) ConsumeLogs(_ context.Context, ld plog.Logs) error

func (*ExampleExporter) ConsumeMetrics added in v0.54.0

func (exp *ExampleExporter) ConsumeMetrics(_ context.Context, md pmetric.Metrics) error

ConsumeMetrics receives pmetric.Metrics for processing by the Metrics.

func (*ExampleExporter) ConsumeTraces added in v0.54.0

func (exp *ExampleExporter) ConsumeTraces(_ context.Context, td ptrace.Traces) error

ConsumeTraces receives ptrace.Traces for processing by the consumer.Traces.

func (*ExampleExporter) Shutdown added in v0.54.0

func (exp *ExampleExporter) Shutdown(context.Context) error

Shutdown is invoked during shutdown.

func (*ExampleExporter) Start added in v0.54.0

Start tells the exporter to start. The exporter may prepare for exporting by connecting to the endpoint. Host parameter can be used for communicating with the host after Start() has already returned.

type ExampleExporterConfig added in v0.54.0

type ExampleExporterConfig struct {
	config.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
}

ExampleExporterConfig config for ExampleExporter.

type ExampleProcessor added in v0.54.0

type ExampleProcessor struct {
	consumer.Traces
	consumer.Metrics
	consumer.Logs
	Started bool
	Stopped bool
}

func (*ExampleProcessor) Capabilities added in v0.54.0

func (ep *ExampleProcessor) Capabilities() consumer.Capabilities

func (*ExampleProcessor) Shutdown added in v0.54.0

func (ep *ExampleProcessor) Shutdown(_ context.Context) error

func (*ExampleProcessor) Start added in v0.54.0

type ExampleProcessorConfig added in v0.54.0

type ExampleProcessorConfig struct {
	config.ProcessorSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
}

ExampleProcessorConfig config for ExampleProcessor.

type ExampleReceiver

type ExampleReceiver struct {
	consumer.Traces
	consumer.Metrics
	consumer.Logs
	Started bool
	Stopped bool
}

ExampleReceiver allows producing traces and metrics for testing purposes.

func (*ExampleReceiver) Shutdown added in v0.54.0

func (erp *ExampleReceiver) Shutdown(context.Context) error

Shutdown tells the receiver that should stop reception,

func (*ExampleReceiver) Start added in v0.54.0

Start tells the receiver to start its processing.

type ExampleReceiverConfig added in v0.54.0

type ExampleReceiverConfig struct {
	config.ReceiverSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
}

ExampleReceiverConfig config for ExampleReceiver.

Jump to

Keyboard shortcuts

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