Skip to content

Commit

Permalink
usm: Enable event stream by default (#31262)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitkyrka authored Nov 21, 2024
1 parent 44782fd commit 9dbee93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/config/setup/system_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func InitSystemProbeConfig(cfg pkgconfigmodel.Config) {
cfg.BindEnv(join(smNS, "enable_quantization"))
cfg.BindEnv(join(smNS, "enable_connection_rollup"))
cfg.BindEnv(join(smNS, "enable_ring_buffers"))
cfg.BindEnv(join(smNS, "enable_event_stream"))
cfg.BindEnvAndSetDefault(join(smNS, "enable_event_stream"), true)

oldHTTPRules := join(netNS, "http_replace_rules")
newHTTPRules := join(smNS, "http_replace_rules")
Expand Down
12 changes: 6 additions & 6 deletions pkg/network/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1344,23 +1344,23 @@ func TestUSMEventStream(t *testing.T) {
mock.NewSystemProbe(t)
cfg := New()

assert.False(t, cfg.EnableUSMEventStream)
assert.True(t, cfg.EnableUSMEventStream)
})

t.Run("via yaml", func(t *testing.T) {
mockSystemProbe := mock.NewSystemProbe(t)
mockSystemProbe.SetWithoutSource("service_monitoring_config.enable_event_stream", true)
mockSystemProbe.SetWithoutSource("service_monitoring_config.enable_event_stream", false)
cfg := New()

assert.True(t, cfg.EnableUSMEventStream)
assert.False(t, cfg.EnableUSMEventStream)
})

t.Run("via deprecated ENV variable", func(t *testing.T) {
t.Run("via ENV variable", func(t *testing.T) {
mock.NewSystemProbe(t)
t.Setenv("DD_SERVICE_MONITORING_CONFIG_ENABLE_EVENT_STREAM", "true")
t.Setenv("DD_SERVICE_MONITORING_CONFIG_ENABLE_EVENT_STREAM", "false")
cfg := New()

assert.True(t, cfg.EnableUSMEventStream)
assert.False(t, cfg.EnableUSMEventStream)
})
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/network/usm/monitor_tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ func setupUSMTLSMonitor(t *testing.T, cfg *config.Config) *Monitor {
usmMonitor, err := NewMonitor(cfg, nil)
require.NoError(t, err)
require.NoError(t, usmMonitor.Start())
if cfg.EnableUSMEventStream {
if cfg.EnableUSMEventStream && usmconfig.NeedProcessMonitor(cfg) {
eventmonitortestutil.StartEventMonitor(t, procmontestutil.RegisterProcessMonitorEventConsumer)
}
t.Cleanup(usmMonitor.Stop)
Expand Down

0 comments on commit 9dbee93

Please sign in to comment.