Skip to content

Commit

Permalink
fix network consumer registration
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Dec 12, 2023
1 parent c7f41fd commit f2fef52
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cmd/system-probe/modules/eventmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/DataDog/datadog-agent/cmd/system-probe/config"
"github.com/DataDog/datadog-agent/pkg/eventmonitor"
emconfig "github.com/DataDog/datadog-agent/pkg/eventmonitor/config"
"github.com/DataDog/datadog-agent/pkg/network/events"
procconsumer "github.com/DataDog/datadog-agent/pkg/process/events/consumer"
secconfig "github.com/DataDog/datadog-agent/pkg/security/config"
secmodule "github.com/DataDog/datadog-agent/pkg/security/module"
Expand Down Expand Up @@ -56,6 +57,15 @@ var EventMonitor = module.Factory{
log.Info("event monitoring cws consumer initialized")
}

if emconfig.NetworkConsumerEnabled {
network, err := events.NewNetworkConsumer(evm)
if err != nil {
return nil, err
}
evm.RegisterEventConsumer(network)
log.Info("event monitoring network consumer initialized")
}

if emconfig.ProcessConsumerEnabled {
process, err := procconsumer.NewProcessConsumer(evm)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

//go:build windows
//go:build !linux

//nolint:revive // TODO(NET) Fix revive linter
package events

import (
"fmt"

"github.com/DataDog/datadog-agent/pkg/eventmonitor"
)

Expand Down

0 comments on commit f2fef52

Please sign in to comment.