diff --git a/examples/datadogagent/datadog-agent-with-otel-agent-annotations.yaml b/examples/datadogagent/datadog-agent-with-otel-agent-annotations.yaml deleted file mode 100644 index e4970e7d4..000000000 --- a/examples/datadogagent/datadog-agent-with-otel-agent-annotations.yaml +++ /dev/null @@ -1,89 +0,0 @@ -apiVersion: datadoghq.com/v2alpha1 -kind: DatadogAgent -metadata: - annotations: - # Note: annotations support is temporary and will be removed in the future. - # Please use otelCollector Feature instead. - agent.datadoghq.com/otel-agent-enabled: "true" - name: datadog -spec: - global: - credentials: - apiKey: - override: - nodeAgent: - customConfigurations: - otel-config.yaml: - configMap: - name: my-datadog-otel-config - items: - - key: otel-config.yaml - path: otel-config.yaml ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: my-datadog-otel-config - labels: - app.kubernetes.io/name: "my-datadog" - app.kubernetes.io/version: "7" -data: - otel-config.yaml: |- - receivers: - prometheus: - config: - scrape_configs: - - job_name: "otel-agent" - scrape_interval: 10s - static_configs: - - targets: ["0.0.0.0:8888"] - otlp: - protocols: - grpc: - endpoint: 0.0.0.0:4317 - http: - endpoint: 0.0.0.0:4318 - exporters: - debug: - verbosity: detailed - datadog: - api: - key: ${env:DD_API_KEY} - processors: - infraattributes: - cardinality: 2 - probabilistic_sampler: - hash_seed: 22 - sampling_percentage: 15.3 - batch: - timeout: 10s - connectors: - datadog/connector: - traces: - compute_top_level_by_span_kind: true - peer_tags_aggregation: true - compute_stats_by_span_kind: true - extensions: - health_check: - service: - extensions: [health_check] - telemetry: - logs: - level: debug - pipelines: - traces: - receivers: [otlp] - processors: [batch] - exporters: [datadog/connector] - traces/sampled: - receivers: [otlp] - processors: [probabilistic_sampler, infraattributes, batch] - exporters: [datadog] - metrics: - receivers: [otlp, datadog/connector, prometheus] - processors: [infraattributes, batch] - exporters: [datadog] - logs: - receivers: [otlp] - processors: [infraattributes, batch] - exporters: [datadog] \ No newline at end of file diff --git a/internal/controller/datadogagent/feature/enabledefault/feature.go b/internal/controller/datadogagent/feature/enabledefault/feature.go index 779033b3a..fdb3835a6 100644 --- a/internal/controller/datadogagent/feature/enabledefault/feature.go +++ b/internal/controller/datadogagent/feature/enabledefault/feature.go @@ -207,14 +207,6 @@ func (f *defaultFeature) Configure(dda *v2alpha1.DatadogAgent) feature.RequiredC agentContainers := make([]apicommon.AgentContainerName, 0) - // If the OpenTelemetry Agent is enabled, add the OTel Agent to the list of required containers for the Agent - // feature. - // - // NOTE: This is a temporary solution until the OTel Agent is fully integrated into the Operator via a dedicated feature. - if dda.ObjectMeta.Annotations != nil && featureutils.HasOtelAgentAnnotation(dda) { - agentContainers = append(agentContainers, apicommon.OtelAgent) - } - // If Agent Data Plane is enabled, add the ADP container to the list of required containers for the Agent feature. if f.adpEnabled { agentContainers = append(agentContainers, apicommon.AgentDataPlaneContainerName) diff --git a/internal/controller/datadogagent/feature/test/factory_test.go b/internal/controller/datadogagent/feature/test/factory_test.go index 8d0491d17..48cc52401 100644 --- a/internal/controller/datadogagent/feature/test/factory_test.go +++ b/internal/controller/datadogagent/feature/test/factory_test.go @@ -165,57 +165,8 @@ func TestBuilder(t *testing.T) { }, }, { - name: "Default DDA, default feature Option, otel-agent-enabled annotation true", + name: "Default DDA, otel collector feature enabled", dda: testutils.NewDatadogAgentBuilder(). - WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "true"}). - BuildWithDefaults(), - wantAgentContainer: map[common.AgentContainerName]bool{ - common.UnprivilegedSingleAgentContainerName: false, - common.CoreAgentContainerName: true, - common.ProcessAgentContainerName: true, - common.TraceAgentContainerName: true, - common.SystemProbeContainerName: false, - common.SecurityAgentContainerName: false, - common.OtelAgent: true, - common.AgentDataPlaneContainerName: false, - }, - }, - { - name: "Default DDA, default feature Option, otel-agent-enabled annotation false", - dda: testutils.NewDatadogAgentBuilder(). - WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "false"}). - BuildWithDefaults(), - wantAgentContainer: map[common.AgentContainerName]bool{ - common.UnprivilegedSingleAgentContainerName: false, - common.CoreAgentContainerName: true, - common.ProcessAgentContainerName: true, - common.TraceAgentContainerName: true, - common.SystemProbeContainerName: false, - common.SecurityAgentContainerName: false, - common.OtelAgent: false, - common.AgentDataPlaneContainerName: false, - }, - }, - { - name: "Default DDA, no otel annotation, Operator option enabled", - dda: testutils.NewDatadogAgentBuilder(). - WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "false"}). - BuildWithDefaults(), - wantAgentContainer: map[common.AgentContainerName]bool{ - common.UnprivilegedSingleAgentContainerName: false, - common.CoreAgentContainerName: true, - common.ProcessAgentContainerName: true, - common.TraceAgentContainerName: true, - common.SystemProbeContainerName: false, - common.SecurityAgentContainerName: false, - common.OtelAgent: false, - common.AgentDataPlaneContainerName: false, - }, - }, - { - name: "Default DDA, otel annotation false, otel collector feature enabled", - dda: testutils.NewDatadogAgentBuilder(). - WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "false"}). WithOTelCollectorEnabled(true). BuildWithDefaults(), wantAgentContainer: map[common.AgentContainerName]bool{ @@ -230,9 +181,8 @@ func TestBuilder(t *testing.T) { }, }, { - name: "Default DDA, otel annotation true, otel collector feature disabled", + name: "Default DDA, otel collector feature disabled", dda: testutils.NewDatadogAgentBuilder(). - WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "true"}). WithOTelCollectorEnabled(false). BuildWithDefaults(), wantAgentContainer: map[common.AgentContainerName]bool{ @@ -242,24 +192,7 @@ func TestBuilder(t *testing.T) { common.TraceAgentContainerName: true, common.SystemProbeContainerName: false, common.SecurityAgentContainerName: false, - common.OtelAgent: true, - common.AgentDataPlaneContainerName: false, - }, - }, - { - name: "Default DDA, otel annotation true, otel collector feature enabled", - dda: testutils.NewDatadogAgentBuilder(). - WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "true"}). - WithOTelCollectorEnabled(true). - BuildWithDefaults(), - wantAgentContainer: map[common.AgentContainerName]bool{ - common.UnprivilegedSingleAgentContainerName: false, - common.CoreAgentContainerName: true, - common.ProcessAgentContainerName: true, - common.TraceAgentContainerName: true, - common.SystemProbeContainerName: false, - common.SecurityAgentContainerName: false, - common.OtelAgent: true, + common.OtelAgent: false, common.AgentDataPlaneContainerName: false, }, }, diff --git a/internal/controller/datadogagent/feature/utils/utils.go b/internal/controller/datadogagent/feature/utils/utils.go index bbe1195ff..5c7c02728 100644 --- a/internal/controller/datadogagent/feature/utils/utils.go +++ b/internal/controller/datadogagent/feature/utils/utils.go @@ -16,7 +16,6 @@ import ( ) const RunInCoreAgentMinVersion = "7.57.0-0" -const enableOtelAnnotation = "agent.datadoghq.com/otel-agent-enabled" const enableAdpAnnotation = "agent.datadoghq.com/adp-enabled" func agentSupportsRunInCoreAgent(dda *v2alpha1.DatadogAgent) bool { @@ -57,12 +56,6 @@ func hasFeatureEnableAnnotation(dda *v2alpha1.DatadogAgent, annotation string) b return false } -// HasOtelAgentAnnotation returns true if the OpenTelemetry Agent is enabled via the dedicated -// `agent.datadoghq.com/otel-agent-enabled` annotation -func HasOtelAgentAnnotation(dda *v2alpha1.DatadogAgent) bool { - return hasFeatureEnableAnnotation(dda, enableOtelAnnotation) -} - // HasAgentDataPlaneAnnotation returns true if the Agent Data Plane is enabled via the dedicated `agent.datadoghq.com/adp-enabled` annotation func HasAgentDataPlaneAnnotation(dda *v2alpha1.DatadogAgent) bool { return hasFeatureEnableAnnotation(dda, enableAdpAnnotation)