Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DJM] Enable DSM on DD_DATA_STREAMS_ENABLED #34688

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pkg/fleet/installer/setup/djm/emr.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,16 @@ func SetupEmr(s *common.Setup) error {
}
s.Config.DatadogYAML.Hostname = hostname
s.Config.DatadogYAML.DJM.Enabled = true
s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = tracerEnvConfigEmr

if os.Getenv("DD_DATA_STREAMS_ENABLED") == "true" {
s.Out.WriteString("Enabling DSM on top of DJM based on env variable DD_DATA_STREAMS_ENABLED=true\n")
DSMEnabled := common.InjectTracerConfigEnvVar{
Key: "DD_DATA_STREAMS_ENABLED",
Value: "true",
}
s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = append(tracerEnvConfigEmr, DSMEnabled)
} else {
s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = tracerEnvConfigEmr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce the branching, we can keep the regular config in all cases and only adjust for dsm, something like this:

s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = tracerEnvConfigEmr

if dataStream {
  s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = append(tracerEnvConfigEmr, DSMEnabled)
}

}
// Ensure tags are always attached with the metrics
s.Config.DatadogYAML.ExpectedTagsDuration = "10m"
isMaster, clusterName, err := setupCommonEmrHostTags(s)
Expand All @@ -100,7 +108,6 @@ func SetupEmr(s *common.Setup) error {
if os.Getenv("DD_EMR_LOGS_ENABLED") == "true" {
s.Out.WriteString("Enabling EMR logs collection based on env variable DD_EMR_LOGS_ENABLED=true\n")
enableEmrLogs(s)

} else {
s.Out.WriteString("EMR logs collection not enabled. To enable it, set DD_EMR_LOGS_ENABLED=true\n")
}
Expand Down
Loading