Skip to content

Commit

Permalink
[mq] working branch - merge 2d73f8d on top of main at fd3f4ff
Browse files Browse the repository at this point in the history
{"baseBranch":"main","baseCommit":"fd3f4ff2a2b66719f4e369cd7546f4bb0c3ee040","createdAt":"2024-07-16T20:29:58.115997Z","headSha":"2d73f8d9a7fd36df3b7106c2f63862ae2ac064b4","id":"85d893c0-3246-4be9-8c2c-9699da88bf74","priority":"200","pullRequestNumber":"27641","queuedAt":"2024-07-16T20:29:58.115130Z","status":"STATUS_QUEUED"}
  • Loading branch information
dd-mergequeue[bot] committed Jul 16, 2024
2 parents ff8ee32 + 2d73f8d commit 69bb5a8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/system-probe/config/adjust_usm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package config

import (
"fmt"
"runtime"

"github.com/DataDog/datadog-agent/pkg/config"
)
Expand Down Expand Up @@ -44,7 +45,14 @@ func adjustUSM(cfg config.Config) {
applyDefault(cfg, smNS("max_concurrent_requests"), cfg.GetInt(spNS("max_tracked_connections")))
deprecateBool(cfg, smNS("process_service_inference", "enabled"), spNS("process_service_inference", "enabled"))
deprecateBool(cfg, smNS("process_service_inference", "use_windows_service_name"), spNS("process_service_inference", "use_windows_service_name"))
applyDefault(cfg, spNS("process_service_inference", "enabled"), false)

// default on windows is now enabled; default on linux is still disabled
if runtime.GOOS == "windows" {
applyDefault(cfg, spNS("process_service_inference", "enabled"), true)
} else {
applyDefault(cfg, spNS("process_service_inference", "enabled"), false)
}

applyDefault(cfg, spNS("process_service_inference", "use_windows_service_name"), true)
applyDefault(cfg, smNS("enable_ring_buffers"), true)
applyDefault(cfg, smNS("max_postgres_stats_buffered"), 100000)
Expand Down
19 changes: 19 additions & 0 deletions pkg/network/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"fmt"
"os"
"regexp"
"runtime"
"strconv"
"testing"
"time"
Expand Down Expand Up @@ -1698,6 +1699,24 @@ system_probe_config:
enabled: true`)
require.False(t, cfg.GetBool("system_probe_config.process_service_inference.enabled"))
})

t.Run("test platform specific defaults", func(t *testing.T) {
aconfig.ResetSystemProbeConfig(t)
// usm or npm must be enabled for the process_service_inference to be enabled
cfg := modelCfgFromYAML(t, `
service_monitoring_config:
enabled: true`)
sysconfig.Adjust(cfg)

var expected bool
if runtime.GOOS == "windows" {
expected = true
} else {
expected = false
}

require.Equal(t, expected, cfg.GetBool("system_probe_config.process_service_inference.enabled"))
})
}

func TestProcessServiceInferenceWindows(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Each section from every release note are combined when the
# CHANGELOG.rst is rendered. So the text needs to be worded so that
# it does not depend on any information only available in another
# section. This may mean repeating some details, but each section
# must be readable independently of the other.
#
# Each section note must be formatted as reStructuredText.
---
features:
- |
On Windows, the default value for the service inference feature is now enabled.

0 comments on commit 69bb5a8

Please sign in to comment.