Skip to content

Commit 08b4cc5

Browse files
brushknightcarlosroman
authored andcommitted
fix: removed custom attributes send heartbeat when running in forwarder mode
1 parent 6503df0 commit 08b4cc5

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

pkg/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,6 +1648,10 @@ func NormalizeConfig(cfg *Config, cfgMetadata config_loader.YAMLMetadata) (err e
16481648

16491649
cfg.IsForwardOnly = cfg.IsForwardOnly || cfg.K8sIntegration
16501650

1651+
if cfg.IsForwardOnly {
1652+
cfg.ConnectEnabled = false
1653+
}
1654+
16511655
// For backwards compatibility FileDevicesBlacklist is deprecated.
16521656
if len(cfg.FileDevicesBlacklist) > 0 {
16531657
cfg.FileDevicesIgnored = append(cfg.FileDevicesIgnored, cfg.FileDevicesBlacklist...)

pkg/plugins/plugins_linux.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ func RegisterPlugins(agent *agnt.Agent) error {
3535
agent.DeprecatePlugin(ids.PluginID{"services", "sysv_init"})
3636
agent.DeprecatePlugin(ids.PluginID{"services", "docker"})
3737

38-
agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))
39-
4038
if config.K8sIntegration {
4139
agent.RegisterPlugin(NewK8sIntegrationsPlugin(agent.Context, agent.Plugins))
4240
}
@@ -46,10 +44,11 @@ func RegisterPlugins(agent *agnt.Agent) error {
4644
}
4745

4846
if config.IsForwardOnly {
49-
registerForwarderHeartbeat(agent)
5047
return nil
5148
}
5249

50+
agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))
51+
5352
// Enabling the hostinfo plugin will make the host appear in the UI
5453
agent.RegisterPlugin(pluginsLinux.NewHostinfoPlugin(agent.Context, agent.GetCloudHarvester()))
5554
agent.RegisterPlugin(NewHostAliasesPlugin(agent.Context, agent.GetCloudHarvester()))

pkg/plugins/plugins_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import (
1717
func RegisterPlugins(agent *agnt.Agent) error {
1818
config := agent.GetContext().Config()
1919

20-
agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))
21-
2220
if config.IsForwardOnly {
2321
return nil
2422
}
@@ -31,6 +29,8 @@ func RegisterPlugins(agent *agnt.Agent) error {
3129
agent.RegisterPlugin(proxy.ConfigPlugin(agent.Context))
3230
}
3331

32+
agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))
33+
3434
if config.IsSecureForwardOnly {
3535
// We need heartbeat samples.
3636
sender := metricsSender.NewSender(agent.Context)

0 commit comments

Comments
 (0)