Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
8 changes: 8 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,14 @@ type ServiceDiscoveryFeatureConfig struct {
// +optional
Enabled *bool `json:"enabled,omitempty"`

// EnabledByDefault is set by the operator when it enables this feature via default configuration,
// as opposed to an explicit user choice. When true, the system-probe binary is not used as a
// fallback if system-probe-lite is unavailable — the container falls back to sleep infinity
// instead, to avoid unexpected resource usage on older agent images.
// This field is managed by the operator and should not be set by users.
// +optional
EnabledByDefault *bool `json:"enabledByDefault,omitempty"`

// Enables the service discovery network stats collection.
// Default: true
// +optional
Expand Down
5 changes: 5 additions & 0 deletions api/datadoghq/v2alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagentinternals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,14 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
EnabledByDefault is set by the operator when it enables this feature via default configuration,
as opposed to an explicit user choice. When true, the system-probe binary is not used as a
fallback if system-probe-lite is unavailable — the container falls back to sleep infinity
instead, to avoid unexpected resource usage on older agent images.
This field is managed by the operator and should not be set by users.
type: boolean
networkStats:
description: |-
Enables the service discovery network stats collection.
Expand Down Expand Up @@ -10909,6 +10917,14 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
EnabledByDefault is set by the operator when it enables this feature via default configuration,
as opposed to an explicit user choice. When true, the system-probe binary is not used as a
fallback if system-probe-lite is unavailable — the container falls back to sleep infinity
instead, to avoid unexpected resource usage on older agent images.
This field is managed by the operator and should not be set by users.
type: boolean
networkStats:
description: |-
Enables the service discovery network stats collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2588,6 +2588,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "EnabledByDefault is set by the operator when it enables this feature via default configuration,\nas opposed to an explicit user choice. When true, the system-probe binary is not used as a\nfallback if system-probe-lite is unavailable — the container falls back to sleep infinity\ninstead, to avoid unexpected resource usage on older agent images.\nThis field is managed by the operator and should not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "Enables the service discovery network stats collection.\nDefault: true",
Expand Down Expand Up @@ -10742,6 +10746,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "EnabledByDefault is set by the operator when it enables this feature via default configuration,\nas opposed to an explicit user choice. When true, the system-probe binary is not used as a\nfallback if system-probe-lite is unavailable — the container falls back to sleep infinity\ninstead, to avoid unexpected resource usage on older agent images.\nThis field is managed by the operator and should not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "Enables the service discovery network stats collection.\nDefault: true",
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagentprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,14 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
EnabledByDefault is set by the operator when it enables this feature via default configuration,
as opposed to an explicit user choice. When true, the system-probe binary is not used as a
fallback if system-probe-lite is unavailable — the container falls back to sleep infinity
instead, to avoid unexpected resource usage on older agent images.
This field is managed by the operator and should not be set by users.
type: boolean
networkStats:
description: |-
Enables the service discovery network stats collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2592,6 +2592,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "EnabledByDefault is set by the operator when it enables this feature via default configuration,\nas opposed to an explicit user choice. When true, the system-probe binary is not used as a\nfallback if system-probe-lite is unavailable — the container falls back to sleep infinity\ninstead, to avoid unexpected resource usage on older agent images.\nThis field is managed by the operator and should not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "Enables the service discovery network stats collection.\nDefault: true",
Expand Down
16 changes: 16 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,14 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
EnabledByDefault is set by the operator when it enables this feature via default configuration,
as opposed to an explicit user choice. When true, the system-probe binary is not used as a
fallback if system-probe-lite is unavailable — the container falls back to sleep infinity
instead, to avoid unexpected resource usage on older agent images.
This field is managed by the operator and should not be set by users.
type: boolean
networkStats:
description: |-
Enables the service discovery network stats collection.
Expand Down Expand Up @@ -10959,6 +10967,14 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
EnabledByDefault is set by the operator when it enables this feature via default configuration,
as opposed to an explicit user choice. When true, the system-probe binary is not used as a
fallback if system-probe-lite is unavailable — the container falls back to sleep infinity
instead, to avoid unexpected resource usage on older agent images.
This field is managed by the operator and should not be set by users.
type: boolean
networkStats:
description: |-
Enables the service discovery network stats collection.
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2588,6 +2588,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "EnabledByDefault is set by the operator when it enables this feature via default configuration,\nas opposed to an explicit user choice. When true, the system-probe binary is not used as a\nfallback if system-probe-lite is unavailable — the container falls back to sleep infinity\ninstead, to avoid unexpected resource usage on older agent images.\nThis field is managed by the operator and should not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "Enables the service discovery network stats collection.\nDefault: true",
Expand Down Expand Up @@ -10807,6 +10811,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "EnabledByDefault is set by the operator when it enables this feature via default configuration,\nas opposed to an explicit user choice. When true, the system-probe binary is not used as a\nfallback if system-probe-lite is unavailable — the container falls back to sleep infinity\ninstead, to avoid unexpected resource usage on older agent images.\nThis field is managed by the operator and should not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "Enables the service discovery network stats collection.\nDefault: true",
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.v2alpha1.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ spec:
| features.sbom.host.analyzers | To use for SBOM collection. |
| features.sbom.host.enabled | Enable this option to activate SBOM collection. Default: false |
| features.serviceDiscovery.enabled | Enables the service discovery check. Default: false |
| features.serviceDiscovery.enabledByDefault | Indicates that the operator enabled this feature automatically rather than in response to an explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on older agent images. This field is managed by the operator and must not be set by users. |
| features.serviceDiscovery.networkStats.enabled | Enables the Service Discovery Network Stats feature. Default: true |
| features.tcpQueueLength.enabled | Enables the TCP queue length eBPF-based check. Default: false |
| features.usm.enabled | Enables Universal Service Monitoring. Default: false |
Expand Down
3 changes: 3 additions & 0 deletions docs/configuration_public.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ spec:
`features.serviceDiscovery.enabled`
: Enables the service discovery check. Default: false

`features.serviceDiscovery.enabledByDefault`
: Indicates that the operator enabled this feature automatically rather than in response to an explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on older agent images. This field is managed by the operator and must not be set by users.

`features.serviceDiscovery.networkStats.enabled`
: Enables the Service Discovery Network Stats feature. Default: true

Expand Down
8 changes: 4 additions & 4 deletions internal/controller/datadogagent/controller_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ func Test_DDAI_ReconcileV3(t *testing.T) {
wantFunc: func(t *testing.T, c client.Client) {
expectedDDAI := getBaseDDAI(dda)
expectedDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "ccac39a3a007bad81d7baf8febc6445f",
constants.MD5DDAIDeploymentAnnotationKey: "62d2822cc8547055dc8e2fca6f222a17",
}

verifyDDAI(t, c, []v1alpha1.DatadogAgentInternal{expectedDDAI})
Expand Down Expand Up @@ -1784,7 +1784,7 @@ func Test_DDAI_ReconcileV3(t *testing.T) {
baseDDAI := getBaseDDAI(dda)
expectedDDAI := baseDDAI.DeepCopy()
expectedDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "f2aa21d0ecced63c091ca2df3d31e451",
constants.MD5DDAIDeploymentAnnotationKey: "c362b9a0aa0e2ad1a1d60f4ee8575c8f",
}
expectedDDAI.Spec.Features.ClusterChecks.UseClusterChecksRunners = apiutils.NewBoolPointer(true)
expectedDDAI.Spec.Global.Credentials = &v2alpha1.DatadogCredentials{
Expand Down Expand Up @@ -1860,7 +1860,7 @@ func Test_DDAI_ReconcileV3(t *testing.T) {
profileDDAI := getBaseDDAI(dda)
profileDDAI.Name = "foo-profile"
profileDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "73e0cc1e445001e326507ac23654104e",
constants.MD5DDAIDeploymentAnnotationKey: "2c3c1664f08fb6d6591294f2c878d1dd",
}
profileDDAI.Labels[constants.ProfileLabelKey] = "foo-profile"
profileDDAI.Spec.Override = map[v2alpha1.ComponentName]*v2alpha1.DatadogAgentComponentOverride{
Expand Down Expand Up @@ -2094,7 +2094,7 @@ func getBaseDDAI(dda *v2alpha1.DatadogAgent) v1alpha1.DatadogAgentInternal {
func getDefaultDDAI(dda *v2alpha1.DatadogAgent) v1alpha1.DatadogAgentInternal {
expectedDDAI := getBaseDDAI(dda)
expectedDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "f98c0497c66e2747f6d116970ab8f0b1",
constants.MD5DDAIDeploymentAnnotationKey: "7e6c12e645247762609327ab80b63d9e",
}
expectedDDAI.Spec.Override = map[v2alpha1.ComponentName]*v2alpha1.DatadogAgentComponentOverride{
v2alpha1.NodeAgentComponentName: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const (
defaultGPUMonitoringEnabled bool = false

defaultServiceDiscoveryEnabled bool = false
defaultServiceDiscoveryEnabledByDefault bool = false
defaultServiceDiscoveryNetworkStatsEnabled bool = true

defaultAPMEnabled bool = true
Expand Down Expand Up @@ -303,9 +304,14 @@ func defaultFeaturesConfig(ddaSpec *v2alpha1.DatadogAgentSpec) {
if ddaSpec.Features.ServiceDiscovery == nil {
ddaSpec.Features.ServiceDiscovery = &v2alpha1.ServiceDiscoveryFeatureConfig{}
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ServiceDiscovery.Enabled, defaultServiceDiscoveryEnabled)
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ServiceDiscovery.EnabledByDefault, defaultServiceDiscoveryEnabledByDefault)
// Only default Enabled to false when not enabled-by-default, so that Enabled=nil remains
// distinguishable from Enabled=false (explicit user opt-out) when EnabledByDefault=true.
if !apiutils.BoolValue(ddaSpec.Features.ServiceDiscovery.EnabledByDefault) {
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ServiceDiscovery.Enabled, defaultServiceDiscoveryEnabled)
}

if *ddaSpec.Features.ServiceDiscovery.Enabled {
if apiutils.BoolValue(ddaSpec.Features.ServiceDiscovery.Enabled) || apiutils.BoolValue(ddaSpec.Features.ServiceDiscovery.EnabledByDefault) {
if ddaSpec.Features.ServiceDiscovery.NetworkStats == nil {
ddaSpec.Features.ServiceDiscovery.NetworkStats = &v2alpha1.ServiceDiscoveryNetworkStatsConfig{}
}
Expand Down
Loading
Loading