Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OTel Agent e2e pipeline tests #29091

Merged
merged 58 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
9d091f3
New tests
liustanley Sep 5, 2024
f9ad75e
Logs fix
liustanley Sep 5, 2024
3dd909c
Revert
liustanley Sep 5, 2024
3d9bba6
Move
liustanley Sep 5, 2024
6488a48
Add test back
liustanley Sep 5, 2024
2477d1f
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Sep 10, 2024
1ef009d
Refactor test structure
liustanley Sep 10, 2024
af8fd85
Fix tabs
liustanley Sep 10, 2024
e907b76
Fix lint
liustanley Sep 10, 2024
7304255
Clean up code
liustanley Sep 10, 2024
393ca55
Add prometheus test
liustanley Sep 10, 2024
9e8cf2e
Fix package comment
liustanley Sep 10, 2024
1a0cc2a
Fix config
liustanley Sep 10, 2024
6cdef1b
Fix helm values
liustanley Sep 11, 2024
1245477
Move batch
liustanley Sep 12, 2024
727cfe8
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Sep 18, 2024
cfc84e7
Add temp tests
liustanley Sep 18, 2024
c559ae6
Fix config
liustanley Sep 18, 2024
8ff38a1
Remove resources
liustanley Sep 20, 2024
b4dd2f0
test
liustanley Sep 23, 2024
0e4ad1f
logs
liustanley Sep 24, 2024
bb09c03
tagger logs
liustanley Sep 24, 2024
44d704a
tagger logs
liustanley Sep 24, 2024
ac65eaa
use remote tagger
liustanley Sep 24, 2024
e3f7615
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Sep 24, 2024
7d148c8
Add calendar app
liustanley Sep 24, 2024
6f28048
Fix lint
liustanley Sep 24, 2024
b2aace1
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Sep 25, 2024
3f91a00
Add EKS test
liustanley Sep 26, 2024
742a3fd
Remove Skip
liustanley Sep 26, 2024
b948349
Add eks test fix
liustanley Sep 26, 2024
995a422
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Sep 26, 2024
6bccac1
test
liustanley Sep 26, 2024
24483a8
lint
liustanley Sep 27, 2024
9189d44
update tests
liustanley Sep 27, 2024
d7bd67f
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Oct 1, 2024
af4189c
Update calendar app names
liustanley Oct 1, 2024
017d07a
Clean up tests
liustanley Oct 2, 2024
af5dae7
go mod tidy
liustanley Oct 2, 2024
b6e70c5
Fix tests
liustanley Oct 2, 2024
fbee8cc
go mod tidy
liustanley Oct 2, 2024
1037dfb
Fix test
liustanley Oct 2, 2024
3c50783
Fix logs test
liustanley Oct 2, 2024
a02cc80
Revert testing changes
liustanley Oct 2, 2024
1e7c20c
Fix change
liustanley Oct 2, 2024
97a394b
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Oct 2, 2024
0363861
Fix tests
liustanley Oct 3, 2024
2e9dd0c
Increase timeout
liustanley Oct 3, 2024
3935bb1
Clean up tests
liustanley Oct 3, 2024
bb62841
Address feedback
liustanley Oct 3, 2024
d3caac9
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Oct 3, 2024
268135d
Address feedback
liustanley Oct 3, 2024
559aec1
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Oct 3, 2024
9342465
inv tidy
liustanley Oct 3, 2024
04656d3
Update version
liustanley Oct 3, 2024
455ea29
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Oct 4, 2024
3a2093e
Merge branch 'main' into stanley.liu/otel-e2e-pipelines
liustanley Oct 4, 2024
d183c15
Mark as flaky
liustanley Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions test/new-e2e/tests/otel/otel-agent/complete_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// 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"
liustanley marked this conversation as resolved.
Show resolved Hide resolved
"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 completeTestSuite struct {
e2e.BaseSuite[environments.Kubernetes]
}

//go:embed config/complete.yml
var completeConfig string

func TestOTelAgentComplete(t *testing.T) {
values := `
agents:
containers:
otelAgent:
env:
- name: DD_OTELCOLLECTOR_CONVERTER_ENABLED
value: 'false'
`
t.Parallel()
e2e.Run(t, &completeTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig)))))
}

func (s *completeTestSuite) TestOTLPTraces() {
utils.TestTraces(s)
}

func (s *completeTestSuite) TestOTLPMetrics() {
utils.TestMetrics(s)
}

func (s *completeTestSuite) TestOTLPLogs() {
utils.TestLogs(s)
}

func (s *completeTestSuite) TestHosts() {
utils.TestHosts(s)
}

func (s *completeTestSuite) TestPrometheusMetrics() {
utils.TestPrometheusMetrics(s)
}
65 changes: 65 additions & 0 deletions test/new-e2e/tests/otel/otel-agent/config/complete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
prometheus:
config:
scrape_configs:
- job_name: 'datadog-agent'
scrape_interval: 10s
static_configs:
- targets: [ '0.0.0.0:8888' ]
exporters:
datadog:
traces:
span_name_as_resource_name: true
metrics:
resource_attributes_as_tags: true
hostname: "otelcol-docker"
api:
key: ${DD_API_KEY}
processors:
batch:
infraattributes:
connectors:
# Use datadog connector to compute stats for pre-sampled traces
datadog/connector:
traces:
span_name_as_resource_name: true
compute_stats_by_span_kind: true
compute_top_level_by_span_kind: true
peer_tags_aggregation: true
extensions:
pprof:
health_check:
zpages:
endpoint: "localhost:55679"
ddflare:
service:
extensions:
[
pprof,
zpages,
health_check,
ddflare,
]
pipelines:
traces:
receivers: [otlp]
processors: [batch, infraattributes]
exporters: [datadog/connector]
traces/send:
receivers: [otlp]
processors: [batch, infraattributes]
exporters: [datadog]
metrics:
receivers: [otlp, datadog/connector, prometheus]
processors: [batch, infraattributes]
exporters: [datadog]
logs:
receivers: [otlp]
processors: [batch, infraattributes]
exporters: [datadog]
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ exporters:
datadog:
traces:
span_name_as_resource_name: true
metrics:
resource_attributes_as_tags: true
hostname: "otelcol-docker"
api:
key: ${DD_API_KEY}
Expand All @@ -20,6 +22,7 @@ connectors:
traces:
span_name_as_resource_name: true
compute_stats_by_span_kind: true
compute_top_level_by_span_kind: true
peer_tags_aggregation: true
service:
pipelines:
Expand Down
46 changes: 46 additions & 0 deletions test/new-e2e/tests/otel/otel-agent/config/sampling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
datadog:
traces:
span_name_as_resource_name: true
metrics:
resource_attributes_as_tags: true
hostname: "otelcol-docker"
api:
key: ${DD_API_KEY}
processors:
batch:
probabilistic_sampler:
sampling_percentage: 50
connectors:
# Use datadog connector to compute stats for pre-sampled traces
datadog/connector:
traces:
span_name_as_resource_name: true
compute_stats_by_span_kind: true
compute_top_level_by_span_kind: true
peer_tags_aggregation: true
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [datadog/connector]
traces/send:
receivers: [datadog/connector]
dineshg13 marked this conversation as resolved.
Show resolved Hide resolved
processors: [batch, probabilistic_sampler]
liustanley marked this conversation as resolved.
Show resolved Hide resolved
exporters: [datadog]
metrics:
receivers: [otlp, datadog/connector]
processors: [batch]
exporters: [datadog]
logs:
receivers: [otlp]
processors: [batch]
exporters: [datadog]
59 changes: 59 additions & 0 deletions test/new-e2e/tests/otel/otel-agent/minimal_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// 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 minimalTestSuite struct {
e2e.BaseSuite[environments.Kubernetes]
}

//go:embed config/minimal.yml
var minimalConfig string

func TestOTelAgentMinimal(t *testing.T) {
t.Parallel()
e2e.Run(t, &minimalTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig)))))
}

func (s *minimalTestSuite) TestOTLPTraces() {
utils.TestTraces(s)
}

func (s *minimalTestSuite) TestOTLPMetrics() {
utils.TestMetrics(s)
}

func (s *minimalTestSuite) TestOTLPLogs() {
utils.TestLogs(s)
}

func (s *minimalTestSuite) TestHosts() {
utils.TestHosts(s)
}

func (s *minimalTestSuite) TestPrometheusMetrics() {
utils.TestPrometheusMetrics(s)
}

func (s *minimalTestSuite) TestOTelAgentInstalled() {
utils.TestOTelAgentInstalled(s)
}

func (s *minimalTestSuite) TestOTelFlare() {
utils.TestOTelFlare(s)
}
35 changes: 35 additions & 0 deletions test/new-e2e/tests/otel/otel-agent/sampling_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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 samplingTestSuite struct {
e2e.BaseSuite[environments.Kubernetes]
}

//go:embed config/sampling.yml
var samplingConfig string

func TestOTelAgentSampling(t *testing.T) {
t.Parallel()
e2e.Run(t, &samplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(samplingConfig)))))
}

func (s *samplingTestSuite) TestSampling() {
utils.TestSampling(s)
}
Loading
Loading