diff --git a/cmd/process-agent/command/main_common.go b/cmd/process-agent/command/main_common.go index 188c9684fd30b..27900103990ca 100644 --- a/cmd/process-agent/command/main_common.go +++ b/cmd/process-agent/command/main_common.go @@ -32,7 +32,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig" "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig/sysprobeconfigimpl" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" - dualTaggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-dual" + taggerRemoteFx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" @@ -177,14 +177,7 @@ func runApp(ctx context.Context, globalParams *GlobalParams) error { return workloadmeta.Params{AgentType: catalog} }), - dualTaggerfx.Module(tagger.DualParams{ - UseRemote: func(c config.Component) bool { - return c.GetBool("process_config.remote_tagger") || - // If the agent is running in ECS or ECS Fargate and the ECS task collection is enabled, use the remote tagger - // as remote tagger can return more tags than the local tagger. - ((env.IsECS() || env.IsECSFargate()) && c.GetBool("ecs_task_collection_enabled")) - }, - }, tagger.Params{}, tagger.RemoteParams{ + taggerRemoteFx.Module(tagger.RemoteParams{ RemoteTarget: func(c config.Component) (string, error) { return fmt.Sprintf(":%v", c.GetInt("cmd_port")), nil }, diff --git a/cmd/process-agent/subcommands/check/check.go b/cmd/process-agent/subcommands/check/check.go index ad2181d4ac90c..f0ba92b597639 100644 --- a/cmd/process-agent/subcommands/check/check.go +++ b/cmd/process-agent/subcommands/check/check.go @@ -27,7 +27,7 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" - dualTaggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-dual" + taggerRemoteFx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" @@ -149,11 +149,7 @@ func MakeCommand(globalParamsGetter func() *command.GlobalParams, name string, a }), // Tagger must be initialized after agent config has been setup - dualTaggerfx.Module(tagger.DualParams{ - UseRemote: func(c config.Component) bool { - return c.GetBool("process_config.remote_tagger") - }, - }, tagger.Params{}, tagger.RemoteParams{ + taggerRemoteFx.Module(tagger.RemoteParams{ RemoteTarget: func(c config.Component) (string, error) { return fmt.Sprintf(":%v", c.GetInt("cmd_port")), nil }, diff --git a/cmd/security-agent/subcommands/start/command.go b/cmd/security-agent/subcommands/start/command.go index dc28b536ec253..75433592febe9 100644 --- a/cmd/security-agent/subcommands/start/command.go +++ b/cmd/security-agent/subcommands/start/command.go @@ -45,7 +45,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig" "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig/sysprobeconfigimpl" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" - dualTaggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-dual" + taggerRemoteFx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/core/telemetry" wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" @@ -113,11 +113,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { AgentType: catalog, } }), - dualTaggerfx.Module(tagger.DualParams{ - UseRemote: func(c config.Component) bool { - return c.GetBool("security_agent.remote_tagger") - }, - }, tagger.Params{}, tagger.RemoteParams{ + taggerRemoteFx.Module(tagger.RemoteParams{ RemoteTarget: func(c config.Component) (string, error) { return fmt.Sprintf(":%v", c.GetInt("cmd_port")), nil }, diff --git a/cmd/trace-agent/subcommands/run/command.go b/cmd/trace-agent/subcommands/run/command.go index e79073508d971..32eb3dc010b06 100644 --- a/cmd/trace-agent/subcommands/run/command.go +++ b/cmd/trace-agent/subcommands/run/command.go @@ -14,7 +14,6 @@ import ( "github.com/spf13/cobra" "go.uber.org/fx" - "github.com/DataDog/datadog-agent/cmd/agent/common" "github.com/DataDog/datadog-agent/cmd/trace-agent/subcommands" "github.com/DataDog/datadog-agent/comp/agent/autoexit" "github.com/DataDog/datadog-agent/comp/agent/autoexit/autoexitimpl" @@ -27,12 +26,9 @@ import ( "github.com/DataDog/datadog-agent/comp/core/secrets" "github.com/DataDog/datadog-agent/comp/core/secrets/secretsimpl" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" - dualTaggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-dual" + taggerRemoteFx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/core/telemetry/telemetryimpl" - wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" - workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd" "github.com/DataDog/datadog-agent/comp/trace" traceagent "github.com/DataDog/datadog-agent/comp/trace/agent/def" @@ -93,19 +89,9 @@ func runTraceAgentProcess(ctx context.Context, cliParams *Params, defaultConfPat return log.ForDaemon("TRACE", "apm_config.log_file", config.DefaultLogFilePath) }), logtracefx.Module(), - // setup workloadmeta - wmcatalog.GetCatalog(), - workloadmetafx.Module(workloadmeta.Params{ - AgentType: workloadmeta.NodeAgent, - InitHelper: common.GetWorkloadmetaInit(), - }), autoexitimpl.Module(), statsd.Module(), - dualTaggerfx.Module(tagger.DualParams{ - UseRemote: func(c coreconfig.Component) bool { - return c.GetBool("apm_config.remote_tagger") - }, - }, tagger.Params{}, tagger.RemoteParams{ + taggerRemoteFx.Module(tagger.RemoteParams{ RemoteTarget: func(c coreconfig.Component) (string, error) { return fmt.Sprintf(":%v", c.GetInt("cmd_port")), nil }, diff --git a/comp/trace/agent/impl/agent.go b/comp/trace/agent/impl/agent.go index 114273121a33b..8ca8cf62d5140 100644 --- a/comp/trace/agent/impl/agent.go +++ b/comp/trace/agent/impl/agent.go @@ -25,7 +25,6 @@ import ( "go.uber.org/fx" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" - workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd" traceagent "github.com/DataDog/datadog-agent/comp/trace/agent/def" compression "github.com/DataDog/datadog-agent/comp/trace/compression/def" @@ -63,7 +62,6 @@ type dependencies struct { Context context.Context Params *Params TelemetryCollector telemetry.TelemetryCollector - Workloadmeta workloadmeta.Component Statsd statsd.Component Tagger tagger.Component Compressor compression.Component @@ -91,7 +89,6 @@ type component struct { params *Params tagger tagger.Component telemetryCollector telemetry.TelemetryCollector - workloadmeta workloadmeta.Component wg *sync.WaitGroup } @@ -111,7 +108,6 @@ func NewAgent(deps dependencies) (traceagent.Component, error) { cancel: cancel, config: deps.Config, params: deps.Params, - workloadmeta: deps.Workloadmeta, telemetryCollector: deps.TelemetryCollector, tagger: deps.Tagger, wg: &sync.WaitGroup{},