-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OTEL-2125] Add E2E test for no dd exporter case
- Loading branch information
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/new-e2e/tests/otel/otel-agent/config/no-dd-exporter.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
endpoint: 0.0.0.0:4317 | ||
http: | ||
endpoint: 0.0.0.0:4318 | ||
|
||
exporters: | ||
debug: | ||
verbosity: detailed | ||
|
||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [otlp] | ||
exporters: [debug] | ||
traces: | ||
receivers: [otlp] | ||
exporters: [debug] | ||
logs: | ||
receivers: [otlp] | ||
exporters: [debug] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
// Package otelagent contains e2e otel agent tests | ||
package otelagent | ||
|
||
import ( | ||
_ "embed" | ||
"testing" | ||
|
||
"github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" | ||
|
||
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" | ||
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" | ||
awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" | ||
"github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" | ||
) | ||
|
||
type noDDExporterTestSuite struct { | ||
e2e.BaseSuite[environments.Kubernetes] | ||
} | ||
|
||
//go:embed config/no-dd-exporter.yml | ||
var noDDExporterConfig string | ||
|
||
func TestOTelAgentWithNoDDExporter(t *testing.T) { | ||
values := ` | ||
datadog: | ||
logs: | ||
containerCollectAll: false | ||
containerCollectUsingFiles: false | ||
` | ||
t.Parallel() | ||
e2e.Run(t, &noDDExporterTestSuite{}, | ||
e2e.WithProvisioner( | ||
awskubernetes.KindProvisioner( | ||
awskubernetes.WithAgentOptions( | ||
kubernetesagentparams.WithoutDualShipping(), | ||
kubernetesagentparams.WithHelmValues(values), | ||
kubernetesagentparams.WithOTelAgent(), | ||
kubernetesagentparams.WithOTelConfig(noDDExporterConfig), | ||
)))) | ||
} | ||
|
||
func (s *noDDExporterTestSuite) TestOTelAgentInstalled() { | ||
utils.TestOTelAgentInstalled(s) | ||
} | ||
|
||
func (s *noDDExporterTestSuite) TestFlare() { | ||
expectedContents := []string{ | ||
"otel-agent", | ||
"ddflare/dd-autoconfigured:", | ||
"health_check/dd-autoconfigured:", | ||
"pprof/dd-autoconfigured:", | ||
"zpages/dd-autoconfigured:", | ||
"infraattributes/dd-autoconfigured:", | ||
"prometheus/dd-autoconfigured:", | ||
} | ||
utils.TestOTelFlare(s, expectedContents) | ||
} |