utils

package
v0.62.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package utils contains util functions for OTel e2e tests

Package utils contains util functions for OTel e2e tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupSampleTraces

func SetupSampleTraces(s OTelTestSuite)

SetupSampleTraces flushes the intake server and starts a telemetrygen job to generate traces

func TestAPMStats

func TestAPMStats(s OTelTestSuite, numTraces int, computeTopLevelBySpanKind bool)

TestAPMStats checks that APM stats are received with the correct number of hits per traces given

func TestCalendarApp

func TestCalendarApp(s OTelTestSuite, ust bool)

TestCalendarApp tests that OTLP metrics are received through OTel pipelines as expected

func TestHosts

func TestHosts(s OTelTestSuite)

TestHosts verifies that OTLP traces, metrics, and logs have consistent hostnames

func TestLogs

func TestLogs(s OTelTestSuite, iaParams IAParams)

TestLogs tests that OTLP logs are received through OTel pipelines as expected

func TestMetrics

func TestMetrics(s OTelTestSuite, iaParams IAParams)

TestMetrics tests that OTLP metrics are received through OTel pipelines as expected

func TestOTelAgentInstalled

func TestOTelAgentInstalled(s OTelTestSuite)

TestOTelAgentInstalled checks that the OTel Agent is installed in the test suite

func TestOTelFlareExtensionResponse

func TestOTelFlareExtensionResponse(s OTelTestSuite, providedCfg string, fullCfg string, sources string)

TestOTelFlareExtensionResponse tests that the OTel Agent DD flare extension returns expected responses

func TestOTelFlareFiles

func TestOTelFlareFiles(s OTelTestSuite)

TestOTelFlareFiles tests that the OTel Agent flares contain the expected files

func TestOTelRemoteConfigPayload

func TestOTelRemoteConfigPayload(s OTelTestSuite, providedCfg string, fullCfg string)

TestOTelRemoteConfigPayload tests that the OTel Agent DD flare extension returns expected responses

func TestPrometheusMetrics

func TestPrometheusMetrics(s OTelTestSuite)

TestPrometheusMetrics tests that expected prometheus metrics are scraped

func TestSampling

func TestSampling(s OTelTestSuite, computeTopLevelBySpanKind bool)

TestSampling tests that APM stats are correct when using probabilistic sampling

func TestTraces

func TestTraces(s OTelTestSuite, iaParams IAParams)

TestTraces tests that OTLP traces are received through OTel pipelines as expected

func TestTracesWithOperationAndResourceName

func TestTracesWithOperationAndResourceName(
	s OTelTestSuite,
	clientOperationName string,
	clientResourceName string,
	serverOperationName string,
	serverResourceName string,
)

TestTracesWithOperationAndResourceName tests that OTLP traces are received through OTel pipelines as expected with updated operation and resource name logic

func TestTracesWithSpanReceiverV2

func TestTracesWithSpanReceiverV2(s OTelTestSuite)

TestTracesWithSpanReceiverV2 tests that OTLP traces are received through OTel pipelines as expected with updated OTLP span receiver

Types

type IAParams

type IAParams struct {
	// InfraAttributes indicates whether this test should check for infra attributes
	InfraAttributes bool

	// EKS indicates if this test should check for EKS specific properties
	EKS bool

	// Cardinality represents the tag cardinality used by this test
	Cardinality types.TagCardinality
}

IAParams contains options for different infra attribute testing scenarios

type OTelMetadata

type OTelMetadata struct {
	Command          string `json:"command"`
	Description      string `json:"description"`
	Enabled          bool   `json:"enabled"`
	ExtensionVersion string `json:"extension_version"`
	extension.ConfigResponse
}

OTelMetadata represents the inventory otel metadata payload

type OTelTestSuite

type OTelTestSuite interface {
	T() *testing.T
	Env() *environments.Kubernetes
}

OTelTestSuite is an interface for the OTel e2e test suite.

type Payload

type Payload struct {
	Hostname     string        `json:"hostname"`
	Timestamp    int64         `json:"timestamp"`
	OTelMetadata *OTelMetadata `json:"otel_metadata"`
	UUID         string        `json:"uuid"`
}

Payload handles the JSON unmarshalling of the metadata payload

Jump to

Keyboard shortcuts

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