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

[feature] Register OTLP feature and add integration tests #626

Merged
merged 1 commit into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions controllers/datadogagent/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (
_ "github.com/DataDog/datadog-operator/controllers/datadogagent/feature/npm"
_ "github.com/DataDog/datadog-operator/controllers/datadogagent/feature/oomkill"
_ "github.com/DataDog/datadog-operator/controllers/datadogagent/feature/orchestratorexplorer"
_ "github.com/DataDog/datadog-operator/controllers/datadogagent/feature/otlp"
_ "github.com/DataDog/datadog-operator/controllers/datadogagent/feature/prometheusscrape"
_ "github.com/DataDog/datadog-operator/controllers/datadogagent/feature/tcpqueuelength"
_ "github.com/DataDog/datadog-operator/controllers/datadogagent/feature/usm"
Expand Down
5 changes: 5 additions & 0 deletions controllers/datadogagent_controller_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ var _ = Describe("V2 Controller - DatadogAgent Deployment", func() {
testFunction(testutils.NewDatadogAgentWithOrchestratorExplorer(namespace, "with-orchestrator-explorer")),
)

Context(
"with OTLP",
testFunction(testutils.NewDatadogAgentWithOTLP(namespace, "with-otlp")),
)

Context(
"with Prometheus scrape",
testFunction(testutils.NewDatadogAgentWithPrometheusScrape(namespace, "with-prometheus-scrape")),
Expand Down
22 changes: 22 additions & 0 deletions controllers/testutils/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,28 @@ func NewDatadogAgentWithOrchestratorExplorer(namespace string, name string) v2al
)
}

// NewDatadogAgentWithOTLP returns an agent with OTLP enabled
func NewDatadogAgentWithOTLP(namespace string, name string) v2alpha1.DatadogAgent {
return newDatadogAgentWithFeatures(
namespace,
name,
&v2alpha1.DatadogFeatures{
OTLP: &v2alpha1.OTLPFeatureConfig{
Receiver: v2alpha1.OTLPReceiverConfig{
Protocols: v2alpha1.OTLPProtocolsConfig{
GRPC: &v2alpha1.OTLPGRPCConfig{
Enabled: apiutils.NewBoolPointer(true),
},
HTTP: &v2alpha1.OTLPHTTPConfig{
Enabled: apiutils.NewBoolPointer(true),
},
},
},
},
},
)
}

// NewDatadogAgentWithPrometheusScrape returns an agent with Prometheus scraping enabled
func NewDatadogAgentWithPrometheusScrape(namespace string, name string) v2alpha1.DatadogAgent {
return newDatadogAgentWithFeatures(
Expand Down