Documentation ¶
Index ¶
- Variables
- func ExampleComponents() (factories component.Factories, err error)
- func NewDefaultFactories() (component.Factories, error)
- type ExampleExporter
- type ExampleExporterConsumer
- func (exp *ExampleExporterConsumer) Capabilities() consumer.Capabilities
- func (exp *ExampleExporterConsumer) ConsumeLogs(_ context.Context, ld plog.Logs) error
- func (exp *ExampleExporterConsumer) ConsumeMetrics(_ context.Context, md pmetric.Metrics) error
- func (exp *ExampleExporterConsumer) ConsumeTraces(_ context.Context, td ptrace.Traces) error
- func (exp *ExampleExporterConsumer) Shutdown(context.Context) error
- func (exp *ExampleExporterConsumer) Start(_ context.Context, _ component.Host) error
- type ExampleExtensionCfg
- type ExampleProcessorCfg
- type ExampleReceiver
- type ExampleReceiverProducer
Constants ¶
This section is empty.
Variables ¶
var ExampleExporterFactory = component.NewExporterFactory( expType, createExporterDefaultConfig, component.WithTracesExporter(createTracesExporter), component.WithMetricsExporter(createMetricsExporter), component.WithLogsExporter(createLogsExporter))
ExampleExporterFactory is factory for ExampleExporter.
var ExampleExtensionFactory = component.NewExtensionFactory( extType, createExtensionDefaultConfig, func(context.Context, component.ExtensionCreateSettings, config.Extension) (component.Extension, error) { return &extension{}, nil })
ExampleExtensionFactory is factory for ExampleExtensionCfg.
var ExampleProcessorFactory = component.NewProcessorFactory( procType, createDefaultConfig, component.WithTracesProcessor(createTracesProcessor), component.WithMetricsProcessor(createMetricsProcessor), component.WithLogsProcessor(createLogsProcessor))
ExampleProcessorFactory is factory for exampleProcessor.
var ExampleReceiverFactory = component.NewReceiverFactory( receiverType, createReceiverDefaultConfig, component.WithTracesReceiver(createTracesReceiver), component.WithMetricsReceiver(createMetricsReceiver), component.WithLogsReceiver(createLogsReceiver))
ExampleReceiverFactory is factory for ExampleReceiver.
Functions ¶
func ExampleComponents ¶
ExampleComponents registers example factories. This is only used by tests.
func NewDefaultFactories ¶ added in v0.46.0
NewDefaultFactories returns the set of components in "testdata/otelcol-config.yaml". This is only used by tests.
Types ¶
type ExampleExporter ¶
type ExampleExporter struct { config.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct ExtraInt int32 `mapstructure:"extra_int"` ExtraSetting string `mapstructure:"extra"` ExtraMapSetting map[string]string `mapstructure:"extra_map"` ExtraListSetting []string `mapstructure:"extra_list"` }
ExampleExporter is for testing purposes. We are defining an example config and factory for "exampleexporter" exporter type.
type ExampleExporterConsumer ¶
type ExampleExporterConsumer struct { Traces []ptrace.Traces Metrics []pmetric.Metrics Logs []plog.Logs ExporterStarted bool ExporterShutdown bool }
ExampleExporterConsumer stores consumed traces and metrics for testing purposes.
func (*ExampleExporterConsumer) Capabilities ¶ added in v0.27.0
func (exp *ExampleExporterConsumer) Capabilities() consumer.Capabilities
func (*ExampleExporterConsumer) ConsumeLogs ¶
func (*ExampleExporterConsumer) ConsumeMetrics ¶
ConsumeMetrics receives pmetric.Metrics for processing by the Metrics.
func (*ExampleExporterConsumer) ConsumeTraces ¶
ConsumeTraces receives ptrace.Traces for processing by the consumer.Traces.
func (*ExampleExporterConsumer) Shutdown ¶
func (exp *ExampleExporterConsumer) Shutdown(context.Context) error
Shutdown is invoked during shutdown.
type ExampleExtensionCfg ¶
type ExampleExtensionCfg struct { config.ExtensionSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct ExtraSetting string `mapstructure:"extra"` ExtraMapSetting map[string]string `mapstructure:"extra_map"` ExtraListSetting []string `mapstructure:"extra_list"` }
ExampleExtensionCfg is for testing purposes. We are defining an example config and factory for "exampleextension" extension type.
type ExampleProcessorCfg ¶
type ExampleProcessorCfg struct { config.ProcessorSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct ExtraSetting string `mapstructure:"extra"` ExtraMapSetting map[string]string `mapstructure:"extra_map"` ExtraListSetting []string `mapstructure:"extra_list"` }
ExampleProcessorCfg is for testing purposes. We are defining an example config and factory for "exampleprocessor" processor type.
type ExampleReceiver ¶
type ExampleReceiver struct { config.ReceiverSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct // Configures the receiver server protocol. confignet.TCPAddr `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct ExtraSetting string `mapstructure:"extra"` ExtraMapSetting map[string]string `mapstructure:"extra_map"` ExtraListSetting []string `mapstructure:"extra_list"` }
ExampleReceiver is for testing purposes. We are defining an example config and factory for "examplereceiver" receiver type.
type ExampleReceiverProducer ¶
type ExampleReceiverProducer struct { Started bool Stopped bool consumer.Traces consumer.Metrics consumer.Logs }
ExampleReceiverProducer allows producing traces and metrics for testing purposes.