Skip to content

Commit 352a5a3

Browse files
committed
make the profiler in bundled mode log in a dedicated file:
while creating the Agent Core in Bundled mode, we were passing `log_file` config value to the host profiler's logger. This value was meant for the agent and made the profiler try to write its logs there. we now have a dedicated logging file, like other agent components.
1 parent 511dd04 commit 352a5a3

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

cmd/host-profiler/subcommands/run/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func runHostProfilerCommand(ctx context.Context, cliParams *cliParams) error {
101101
remotehostnameimpl.Module(),
102102
fx.Supply(core.BundleParams{
103103
ConfigParams: config.NewAgentParams(cliParams.GlobalParams.CoreConfPath),
104-
LogParams: log.ForDaemon(command.LoggerName, "log_file", defaultpaths.GetDefaultHostProfilerLogFile()),
104+
LogParams: log.ForDaemon(command.LoggerName, "hostprofiler.log_file", defaultpaths.GetDefaultHostProfilerLogFile()),
105105
}),
106106
fx.Provide(collectorimpl.NewExtraFactoriesWithAgentCore),
107107
fx.Invoke(func(l log.Component) {

pkg/config/setup/common_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ func initCoreAgentFull(config pkgconfigmodel.Setup) {
11231123
// Integrations excluded from these restrictions.
11241124
config.BindEnvAndSetDefault("integration_security_excluded_checks", []string{})
11251125

1126+
config.BindEnvAndSetDefault("hostprofiler.log_file", "${log_path}/host-profiler.log")
11261127
config.BindEnvAndSetDefault("hostprofiler.debug.verbosity", "")
11271128
config.BindEnvAndSetDefault("hostprofiler.additional_http_headers", map[string]string{})
11281129
config.BindEnvAndSetDefault("hostprofiler.ddprofiling.enabled", false)

0 commit comments

Comments
 (0)