processortest

package
v0.37.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestLogs

func CreateTestLogs(logJson string) plog.Logs

logJson should match format from the protobuf definition: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/logs/v1/logs.proto

func CreateTestMetrics

func CreateTestMetrics(metricJson string) pmetric.Metrics

metricJson should match format from the protobuf definition: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto

func CreateTestTraces

func CreateTestTraces(traceJson string) ptrace.Traces

traceJson should match format from the protobuf definition: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto

func TestRunProcessor

func TestRunProcessor(c ProcessorRunConfig)

Types

type ProcessorRunConfig

type ProcessorRunConfig struct {
	Ctx        context.Context
	T          *testing.T
	Args       component.Arguments
	TestSignal Signal
	Ctrl       *componenttest.Controller
	L          log.Logger
}

type Signal

type Signal interface {
	MakeOutput() *otelcol.ConsumerArguments
	ConsumeInput(ctx context.Context, consumer otelcol.Consumer) error
	CheckOutput(t *testing.T)
}

func NewLogSignal

func NewLogSignal(inputJson string, expectedOutputJson string) Signal

func NewMetricSignal

func NewMetricSignal(inputJson string, expectedOutputJson string) Signal

func NewTraceSignal

func NewTraceSignal(inputJson string, expectedOutputJson string) Signal

func NewTraceToLogSignal added in v0.37.0

func NewTraceToLogSignal(inputJson string, expectedOutputJson string) Signal

Jump to

Keyboard shortcuts

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