receivertest

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 20 Imported by: 12

Documentation

Index

Constants

View Source
const UniqueIDAttrName = "test_id"

UniqueIDAttrName is the attribute name that is used in log records/spans/datapoints as the unique identifier.

Variables

This section is empty.

Functions

func CheckConsumeContract added in v0.79.0

func CheckConsumeContract(params CheckConsumeContractParams)

CheckConsumeContract checks the contract between the receiver and its next consumer. For the contract description see ../doc.go. The checker will detect violations of contract on different scenarios: on success, on permanent and non-permanent errors and mix of error types.

func CreateExponentialHistogramMetricWithID added in v0.96.0

func CreateExponentialHistogramMetricWithID(id UniqueIDAttrVal) pmetric.Metrics

func CreateGaugeMetricWithID added in v0.96.0

func CreateGaugeMetricWithID(id UniqueIDAttrVal) pmetric.Metrics

func CreateHistogramMetricWithID added in v0.96.0

func CreateHistogramMetricWithID(id UniqueIDAttrVal) pmetric.Metrics

func CreateOneLogWithID added in v0.79.0

func CreateOneLogWithID(id UniqueIDAttrVal) plog.Logs

func CreateOneSpanWithID added in v0.96.0

func CreateOneSpanWithID(id UniqueIDAttrVal) ptrace.Traces

func CreateSumMetricWithID added in v0.96.0

func CreateSumMetricWithID(id UniqueIDAttrVal) pmetric.Metrics

func CreateSummaryMetricWithID added in v0.96.0

func CreateSummaryMetricWithID(id UniqueIDAttrVal) pmetric.Metrics

func NewNopBuilder

func NewNopBuilder() *receiver.Builder

NewNopBuilder returns a receiver.Builder that constructs nop receivers.

func NewNopCreateSettings

func NewNopCreateSettings() receiver.CreateSettings

NewNopCreateSettings returns a new nop settings for Create*Receiver functions.

func NewNopFactory

func NewNopFactory() receiver.Factory

NewNopFactory returns a receiver.Factory that constructs nop receivers supporting all data types.

func NewNopFactoryForType added in v0.98.0

func NewNopFactoryForType(dataType component.DataType) receiver.Factory

NewNopFactoryForType returns a receiver.Factory that constructs nop receivers supporting only the given data type.

Types

type CheckConsumeContractParams added in v0.79.0

type CheckConsumeContractParams struct {
	T *testing.T
	// Factory that allows to create a receiver.
	Factory receiver.Factory
	// DataType to test for.
	DataType component.DataType
	// Config of the receiver to use.
	Config component.Config
	// Generator that can send data to the receiver.
	Generator Generator
	// GenerateCount specifies the number of times to call the generator.Generate()
	// for each test scenario.
	GenerateCount int
}

type Generator added in v0.79.0

type Generator interface {
	// Start the generator and prepare to generate. Will be followed by calls to Generate().
	// Start() may be called again after Stop() is called to begin a new test scenario.
	Start()

	// Stop generating. There will be no more calls to Generate() until Start() is called again.
	Stop()

	// Generate must generate and send at least one data element (span, log record or metric data point)
	// to the receiver and return a copy of generated element ids.
	// The generated data must contain uniquely identifiable elements, each with a
	// different value of attribute named UniqueIDAttrName.
	// CreateOneLogWithID() can be used a helper to create such logs.
	// May be called concurrently from multiple goroutines.
	Generate() []UniqueIDAttrVal
}

type UniqueIDAttrVal added in v0.79.0

type UniqueIDAttrVal string

UniqueIDAttrVal is the value type of the UniqueIDAttrName.

Jump to

Keyboard shortcuts

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