Skip to content

Commit

Permalink
Add dd-agent to group with read permission
Browse files Browse the repository at this point in the history
  • Loading branch information
aboitreaud committed Jan 22, 2025
1 parent 028732a commit 6f32599
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/fleet/installer/setup/djm/dataproc.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ func SetupDataproc(s *common.Setup) error {
}
// Add logs config to both Resource Manager and Workers
var sparkIntegration common.IntegrationConfig
if os.Getenv("DD_LOGS_ENABLED") == "true" {
if os.Getenv("DD_DATAPROC_LOGS_ENABLED") == "true" {
// Add dd-agent to yarn group to give the Agent permission to READ the Spark log files
_, err := executeCommandWithTimeout(s, "sudo", "usermod", "-aG", "yarn", "dd-agent")
if err != nil {
log.Warnf("error changing permission group for log file, dd-agent won't have access to Dataproc logs: %v", err)
return nil
}
s.Config.DatadogYAML.LogsEnabled = true
sparkIntegration.Logs = dataprocLogs
}
Expand Down

0 comments on commit 6f32599

Please sign in to comment.