utils

package
v0.66.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 22 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

View Source
const (
	// CalendarService is the default service value for the calendar app
	CalendarService = "calendar-rest-go"
)

Variables

This section is empty.

Functions

func TestCalendarApp

func TestCalendarApp(s OTelTestSuite, ust bool, service string)

TestCalendarApp starts the calendar app to send telemetry for e2e tests

func TestCalendarAppDocker added in v0.65.0

func TestCalendarAppDocker(s OTelDockerTestSuite)

TestCalendarAppDocker verifies the calendar app is sending telemetry for e2e tests

func TestCoreAgentConfigCmd added in v0.64.0

func TestCoreAgentConfigCmd(s OTelTestSuite, expectedCfg string)

TestCoreAgentConfigCmd tests the output of core agent's config command contains the embedded collector's config

func TestCoreAgentStatusCmd added in v0.64.0

func TestCoreAgentStatusCmd(s OTelTestSuite)

TestCoreAgentStatusCmd tests the core agent status command contains the OTel Agent status as expected

func TestHostMetrics added in v0.63.0

func TestHostMetrics(s OTelTestSuite)

TestHostMetrics tests that expected host metrics are scraped

func TestHosts

func TestHosts(s OTelTestSuite)

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

func TestLoadBalancing added in v0.65.0

func TestLoadBalancing(s OTelTestSuite)

TestLoadBalancing verifies that the loadbalancingexporter correctly routes traces and metrics by service

func TestLogs

func TestLogs(s OTelTestSuite, iaParams IAParams)

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

func TestLogsDocker added in v0.65.0

func TestLogsDocker(s OTelDockerTestSuite)

TestLogsDocker 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 TestMetricsDocker added in v0.65.0

func TestMetricsDocker(s OTelDockerTestSuite)

TestMetricsDocker 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 TestOTelAgentStatusCmd added in v0.64.0

func TestOTelAgentStatusCmd(s OTelTestSuite)

TestOTelAgentStatusCmd tests the OTel Agent status subcommand returns as expected

func TestOTelFlareExtensionResponse added in v0.61.0

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

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

func TestOTelFlareFiles added in v0.61.0

func TestOTelFlareFiles(s OTelTestSuite)

TestOTelFlareFiles tests that the OTel Agent flares contain the expected files

func TestOTelRemoteConfigPayload added in v0.61.0

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 TestTracesDocker added in v0.65.0

func TestTracesDocker(s OTelDockerTestSuite)

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

func TestTracesWithOperationAndResourceName added in v0.61.0

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 added in v0.61.0

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 OTelDockerTestSuite added in v0.65.0

type OTelDockerTestSuite interface {
	T() *testing.T
	Env() *environments.DockerHost
}

OTelDockerTestSuite is an interface for the OTel e2e test suite.

type OTelMetadata added in v0.61.0

type OTelMetadata struct {
	Command          string `json:"command"`
	Description      string `json:"description"`
	Enabled          bool   `json:"enabled"`
	ExtensionVersion string `json:"extension_version"`
	extensiontypes.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 added in v0.61.0

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