Documentation ¶
Index ¶
- Variables
- func ExampleComponents() (factories component.Factories, err error)
- type ExampleExporter
- type ExampleExporterConsumer
- func (exp *ExampleExporterConsumer) Capabilities() consumer.Capabilities
- func (exp *ExampleExporterConsumer) ConsumeLogs(_ context.Context, ld pdata.Logs) error
- func (exp *ExampleExporterConsumer) ConsumeMetrics(_ context.Context, md pdata.Metrics) error
- func (exp *ExampleExporterConsumer) ConsumeTraces(_ context.Context, td pdata.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 = exporterhelper.NewFactory( expType, createExporterDefaultConfig, exporterhelper.WithTraces(createTracesExporter), exporterhelper.WithMetrics(createMetricsExporter), exporterhelper.WithLogs(createLogsExporter))
ExampleExporterFactory is factory for ExampleExporter.
var ExampleExtensionFactory = extensionhelper.NewFactory(extType, createExtensionDefaultConfig, createExtension)
ExampleExtensionFactory is factory for ExampleExtensionCfg.
var ExampleProcessorFactory = processorhelper.NewFactory( procType, createDefaultConfig, processorhelper.WithTraces(createTracesProcessor), processorhelper.WithMetrics(createMetricsProcessor), processorhelper.WithLogs(createLogsProcessor))
ExampleProcessorFactory is factory for exampleProcessor.
var ExampleReceiverFactory = receiverhelper.NewFactory( receiverType, createReceiverDefaultConfig, receiverhelper.WithTraces(createTracesReceiver), receiverhelper.WithMetrics(createMetricsReceiver), receiverhelper.WithLogs(createLogsReceiver))
ExampleReceiverFactory is factory for ExampleReceiver.
Functions ¶
func ExampleComponents ¶
ExampleComponents registers example factories. 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.
func (*ExampleExporter) Unmarshal ¶ added in v0.25.0
func (cfg *ExampleExporter) Unmarshal(componentParser *configparser.Parser) error
Unmarshal a viper data into the config struct
type ExampleExporterConsumer ¶
type ExampleExporterConsumer struct { Traces []pdata.Traces Metrics []pdata.Metrics Logs []pdata.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 pdata.Metrics for processing by the Metrics.
func (*ExampleExporterConsumer) ConsumeTraces ¶
ConsumeTraces receives pdata.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.