testcomponents

package
v0.118.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleConnectorFactory = xconnector.NewFactory(
	connType,
	createExampleConnectorDefaultConfig,

	xconnector.WithTracesToTraces(createExampleTracesToTraces, component.StabilityLevelDevelopment),
	xconnector.WithTracesToMetrics(createExampleTracesToMetrics, component.StabilityLevelDevelopment),
	xconnector.WithTracesToLogs(createExampleTracesToLogs, component.StabilityLevelDevelopment),
	xconnector.WithTracesToProfiles(createExampleTracesToProfiles, component.StabilityLevelDevelopment),

	xconnector.WithMetricsToTraces(createExampleMetricsToTraces, component.StabilityLevelDevelopment),
	xconnector.WithMetricsToMetrics(createExampleMetricsToMetrics, component.StabilityLevelDevelopment),
	xconnector.WithMetricsToLogs(createExampleMetricsToLogs, component.StabilityLevelDevelopment),
	xconnector.WithMetricsToProfiles(createExampleMetricsToProfiles, component.StabilityLevelDevelopment),

	xconnector.WithLogsToTraces(createExampleLogsToTraces, component.StabilityLevelDevelopment),
	xconnector.WithLogsToMetrics(createExampleLogsToMetrics, component.StabilityLevelDevelopment),
	xconnector.WithLogsToLogs(createExampleLogsToLogs, component.StabilityLevelDevelopment),
	xconnector.WithLogsToProfiles(createExampleLogsToProfiles, component.StabilityLevelDevelopment),

	xconnector.WithProfilesToTraces(createExampleProfilesToTraces, component.StabilityLevelDevelopment),
	xconnector.WithProfilesToMetrics(createExampleProfilesToMetrics, component.StabilityLevelDevelopment),
	xconnector.WithProfilesToLogs(createExampleProfilesToLogs, component.StabilityLevelDevelopment),
	xconnector.WithProfilesToProfiles(createExampleProfilesToProfiles, component.StabilityLevelDevelopment),
)

ExampleConnectorFactory is factory for ExampleConnector.

View Source
var ExampleExporterFactory = xexporter.NewFactory(
	exporterType,
	createExporterDefaultConfig,
	xexporter.WithTraces(createTracesExporter, component.StabilityLevelDevelopment),
	xexporter.WithMetrics(createMetricsExporter, component.StabilityLevelDevelopment),
	xexporter.WithLogs(createLogsExporter, component.StabilityLevelDevelopment),
	xexporter.WithProfiles(createProfilesExporter, component.StabilityLevelDevelopment),
)

ExampleExporterFactory is factory for ExampleExporter.

View Source
var ExampleProcessorFactory = xprocessor.NewFactory(
	procType,
	createDefaultConfig,
	xprocessor.WithTraces(createTracesProcessor, component.StabilityLevelDevelopment),
	xprocessor.WithMetrics(createMetricsProcessor, component.StabilityLevelDevelopment),
	xprocessor.WithLogs(createLogsProcessor, component.StabilityLevelDevelopment),
	xprocessor.WithProfiles(createProfilesProcessor, component.StabilityLevelDevelopment),
)

ExampleProcessorFactory is factory for ExampleProcessor.

View Source
var ExampleReceiverFactory = xreceiver.NewFactory(
	receiverType,
	createReceiverDefaultConfig,
	xreceiver.WithTraces(createTracesReceiver, component.StabilityLevelDevelopment),
	xreceiver.WithMetrics(createMetricsReceiver, component.StabilityLevelDevelopment),
	xreceiver.WithLogs(createLogsReceiver, component.StabilityLevelDevelopment),
	xreceiver.WithProfiles(createProfilesReceiver, component.StabilityLevelDevelopment),
)

ExampleReceiverFactory is factory for ExampleReceiver.

View Source
var ExampleRouterFactory = xconnector.NewFactory(
	routerType,
	createExampleRouterDefaultConfig,
	xconnector.WithTracesToTraces(createExampleTracesRouter, component.StabilityLevelDevelopment),
	xconnector.WithMetricsToMetrics(createExampleMetricsRouter, component.StabilityLevelDevelopment),
	xconnector.WithLogsToLogs(createExampleLogsRouter, component.StabilityLevelDevelopment),
	xconnector.WithProfilesToProfiles(createExampleProfilesRouter, component.StabilityLevelDevelopment),
)

ExampleRouterFactory is factory for ExampleRouter.

View Source
var MockForwardConnectorFactory = xconnector.NewFactory(
	component.MustNewType("mockforward"),
	createExampleConnectorDefaultConfig,
	xconnector.WithTracesToTraces(createExampleTracesToTraces, component.StabilityLevelDevelopment),
	xconnector.WithMetricsToMetrics(createExampleMetricsToMetrics, component.StabilityLevelDevelopment),
	xconnector.WithLogsToLogs(createExampleLogsToLogs, component.StabilityLevelDevelopment),
	xconnector.WithProfilesToProfiles(createExampleProfilesToProfiles, component.StabilityLevelDevelopment),
)

Functions

This section is empty.

Types

type ExampleConnector

type ExampleConnector struct {
	consumer.ConsumeTracesFunc
	consumer.ConsumeMetricsFunc
	consumer.ConsumeLogsFunc
	xconsumer.ConsumeProfilesFunc
	// contains filtered or unexported fields
}

func (*ExampleConnector) Capabilities

func (c *ExampleConnector) Capabilities() consumer.Capabilities

func (*ExampleConnector) Shutdown

func (cs *ExampleConnector) Shutdown(context.Context) error

func (*ExampleConnector) Start

func (cs *ExampleConnector) Start(context.Context, component.Host) error

func (*ExampleConnector) Started

func (cs *ExampleConnector) Started() bool

func (*ExampleConnector) Stopped

func (cs *ExampleConnector) Stopped() bool

type ExampleExporter

type ExampleExporter struct {
	Traces   []ptrace.Traces
	Metrics  []pmetric.Metrics
	Logs     []plog.Logs
	Profiles []pprofile.Profiles
	// contains filtered or unexported fields
}

ExampleExporter stores consumed traces, metrics, logs and profiles for testing purposes.

func (*ExampleExporter) Capabilities

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

func (*ExampleExporter) ConsumeLogs

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

ConsumeLogs receives plog.Logs for processing by the Logs.

func (*ExampleExporter) ConsumeMetrics

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

ConsumeMetrics receives pmetric.Metrics for processing by the Metrics.

func (*ExampleExporter) ConsumeProfiles added in v0.109.0

func (exp *ExampleExporter) ConsumeProfiles(_ context.Context, td pprofile.Profiles) error

ConsumeProfiles receives pprofile.Profiles for processing by the xconsumer.Profiles.

func (*ExampleExporter) ConsumeTraces

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

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

func (*ExampleExporter) Shutdown

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

func (*ExampleExporter) Start

func (cs *ExampleExporter) Start(context.Context, component.Host) error

func (*ExampleExporter) Started

func (cs *ExampleExporter) Started() bool

func (*ExampleExporter) Stopped

func (cs *ExampleExporter) Stopped() bool

type ExampleProcessor

type ExampleProcessor struct {
	consumer.ConsumeTracesFunc
	consumer.ConsumeMetricsFunc
	consumer.ConsumeLogsFunc
	xconsumer.ConsumeProfilesFunc
	// contains filtered or unexported fields
}

func (*ExampleProcessor) Capabilities

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

func (*ExampleProcessor) Shutdown

func (cs *ExampleProcessor) Shutdown(context.Context) error

func (*ExampleProcessor) Start

func (cs *ExampleProcessor) Start(context.Context, component.Host) error

func (*ExampleProcessor) Started

func (cs *ExampleProcessor) Started() bool

func (*ExampleProcessor) Stopped

func (cs *ExampleProcessor) Stopped() bool

type ExampleReceiver

type ExampleReceiver struct {
	consumer.ConsumeTracesFunc
	consumer.ConsumeMetricsFunc
	consumer.ConsumeLogsFunc
	xconsumer.ConsumeProfilesFunc
	// contains filtered or unexported fields
}

ExampleReceiver allows producing traces, metrics, logs and profiles for testing purposes.

func (*ExampleReceiver) Shutdown

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

func (*ExampleReceiver) Start

func (cs *ExampleReceiver) Start(context.Context, component.Host) error

func (*ExampleReceiver) Started

func (cs *ExampleReceiver) Started() bool

func (*ExampleReceiver) Stopped

func (cs *ExampleReceiver) Stopped() bool

type ExampleRouter

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

func (*ExampleRouter) Capabilities

func (r *ExampleRouter) Capabilities() consumer.Capabilities

func (*ExampleRouter) ConsumeLogs

func (r *ExampleRouter) ConsumeLogs(ctx context.Context, ld plog.Logs) error

func (*ExampleRouter) ConsumeMetrics

func (r *ExampleRouter) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error

func (*ExampleRouter) ConsumeProfiles added in v0.109.0

func (r *ExampleRouter) ConsumeProfiles(ctx context.Context, td pprofile.Profiles) error

func (*ExampleRouter) ConsumeTraces

func (r *ExampleRouter) ConsumeTraces(ctx context.Context, td ptrace.Traces) error

func (*ExampleRouter) Shutdown

func (cs *ExampleRouter) Shutdown(context.Context) error

func (*ExampleRouter) Start

func (cs *ExampleRouter) Start(context.Context, component.Host) error

func (*ExampleRouter) Started

func (cs *ExampleRouter) Started() bool

func (*ExampleRouter) Stopped

func (cs *ExampleRouter) Stopped() bool

type ExampleRouterConfig

type ExampleRouterConfig struct {
	Traces   *LeftRightConfig `mapstructure:"traces"`
	Metrics  *LeftRightConfig `mapstructure:"metrics"`
	Logs     *LeftRightConfig `mapstructure:"logs"`
	Profiles *LeftRightConfig `mapstructure:"profiles"`
}

type LeftRightConfig

type LeftRightConfig struct {
	Left  pipeline.ID `mapstructure:"left"`
	Right pipeline.ID `mapstructure:"right"`
}

Jump to

Keyboard shortcuts

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