Documentation
¶
Overview ¶
Package utils contains util functions for OTel e2e tests
Package utils contains util functions for OTel e2e tests ¶
Package utils contains util functions for OTel e2e tests
Index ¶
- Constants
- func TestCalendarApp(s OTelTestSuite, ust bool, service string)
- func TestCalendarAppDocker(s OTelDockerTestSuite)
- func TestCoreAgentConfigCmd(s OTelTestSuite, expectedCfg string)
- func TestCoreAgentStatusCmd(s OTelTestSuite)
- func TestDatadogExtensionPayload(s OTelTestSuite, fullCfg string)
- func TestDogtelLivenessMetric(s OTelTestSuite)
- func TestDogtelTaggerServerRunning(s OTelTestSuite, port int)
- func TestHeadBasedSamplingScaling(s OTelTestSuite)
- func TestHostMetrics(s OTelTestSuite)
- func TestHosts(s OTelTestSuite)
- func TestLoadBalancing(s OTelTestSuite)
- func TestLogs(s OTelTestSuite, iaParams IAParams)
- func TestLogsDocker(s OTelDockerTestSuite)
- func TestMetrics(s OTelTestSuite, iaParams IAParams)
- func TestMetricsDocker(s OTelDockerTestSuite)
- func TestOTelAgentFlareCmd(s OTelTestSuite)
- func TestOTelAgentInstalled(s OTelTestSuite)
- func TestOTelAgentStatusCmd(s OTelTestSuite)
- func TestOTelFlareExtensionResponse(s OTelTestSuite, providedCfg string, fullCfg string, sources string)
- func TestOTelFlareFiles(s OTelTestSuite)
- func TestOTelGatewayFlareCmd(s OTelTestSuite)
- func TestOTelGatewayInstalled(s OTelTestSuite)
- func TestPrometheusMetrics(s OTelTestSuite)
- func TestSampling(s OTelTestSuite, computeTopLevelBySpanKind bool)
- func TestTraces(s OTelTestSuite, iaParams IAParams)
- func TestTracesDocker(s OTelDockerTestSuite)
- func TestTracesWithOperationAndResourceName(s OTelTestSuite, clientOperationName string, clientResourceName string, ...)
- func TestTracesWithSpanReceiverV2(s OTelTestSuite)
- type BuildInfo
- type IAParams
- type OTelCollectorMetadata
- type OTelDockerTestSuite
- type OTelTestSuite
- type Payload
Constants ¶
const (
// CalendarService is the default service value for the calendar app
CalendarService = "calendar-rest-go"
)
const (
// DogtelLivenessMetricName is the metric emitted by the dogtelextension on every Start()
DogtelLivenessMetricName = "otel.dogtel_extension.running"
)
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 TestDatadogExtensionPayload ¶ added in v0.76.0
func TestDatadogExtensionPayload(s OTelTestSuite, fullCfg string)
TestDatadogExtensionPayload tests that the OTel Agent DD extension returns expected responses
func TestDogtelLivenessMetric ¶ added in v0.80.0
func TestDogtelLivenessMetric(s OTelTestSuite)
TestDogtelLivenessMetric verifies that the dogtelextension emits its liveness gauge metric. The metric is sent on Start() when otel_standalone=true and should appear in the fake intake.
func TestDogtelTaggerServerRunning ¶ added in v0.80.0
func TestDogtelTaggerServerRunning(s OTelTestSuite, port int)
TestDogtelTaggerServerRunning verifies that the dogtel tagger gRPC server is listening on the expected port inside the otel-agent container.
func TestHeadBasedSamplingScaling ¶
func TestHeadBasedSamplingScaling(s OTelTestSuite)
TestHeadBasedSamplingScaling validates that the Datadog connector scales APM stats up by the W3C tracestate head-sampling weight.
The accompanying config (config/sampling-head-based.yml) runs two connectors over the same OTLP stream:
- datadog/unsampled sees 100% of traffic (service "calendar-rest-go"), so its Hits are the ground-truth volume.
- datadog/sampled sits behind a 50% proportional probabilistic_sampler that stamps an "ot=th:" tracestate; its service is renamed to "calendar-rest-go-sampled". It observes only the sampled subset and must recover the sampling weight from the tracestate to scale its Hits back up.
With correct scaling the sampled connector's Hits approximate the unsampled baseline (ratio ~1.0). Without scaling they would be roughly half (~0.5), so the ratio band below both requires the fix and tolerates 50% sampling variance.
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 TestOTelAgentFlareCmd ¶ added in v0.76.0
func TestOTelAgentFlareCmd(s OTelTestSuite)
TestOTelAgentFlareCmd tests the OTel Agent flare subcommand executes successfully and validates the flare contents
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 TestOTelGatewayFlareCmd ¶ added in v0.76.0
func TestOTelGatewayFlareCmd(s OTelTestSuite)
TestOTelGatewayFlareCmd tests the OTel Gateway flare subcommand executes successfully and validates the flare contents
func TestOTelGatewayInstalled ¶ added in v0.75.0
func TestOTelGatewayInstalled(s OTelTestSuite)
TestOTelGatewayInstalled checks that the OTel Gateway collector is installed in the test suite
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 OTelCollectorMetadata ¶ added in v0.76.0
type OTelCollectorMetadata struct {
BuildInfo BuildInfo `json:"build_info"`
FullConfiguration string `json:"full_configuration"`
}
OTelCollectorMetadata represents the datadog extension metadata payload
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 OTelTestSuite ¶
type OTelTestSuite interface {
T() *testing.T
Env() *environments.Kubernetes
}
OTelTestSuite is an interface for the OTel e2e test suite.