Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
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
3 changes: 3 additions & 0 deletions comp/otelcol/collector-contrib/impl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ replace github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1

replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230726162818-81f778f3b3ec

// TODO: Remove this replace once v0.148.0 is released
replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/datadogextension v0.147.0 => github.com/DataDog/opentelemetry-collector-contrib/extension/datadogextension v0.147.1-0.20260319095942-6b90e15b61ca

// This section was automatically added by 'dda inv modules.add-all-replace' command, do not edit manually

replace (
Expand Down
4 changes: 2 additions & 2 deletions comp/otelcol/collector-contrib/impl/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions comp/otelcol/converter/impl/autoconfigure.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ func (c *ddConverter) enhanceConfig(ctx context.Context, conf *confmap.Conf) {
"key": c.coreConfig.GetString("api_key"),
"site": site,
},
"deployment_type": deploymentType,
"hostname": resolvedHostname,
"deployment_type": deploymentType,
"hostname": resolvedHostname,
"installation_method": c.coreConfig.GetString("otelcollector.installation_method"),
Comment thread
liustanley marked this conversation as resolved.
}
}
addComponentToConfig(conf, extension)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extensions:
site: "datadoghq.com"
deployment_type: daemonset
hostname: test-host
installation_method: ""
ddflare/dd-autoconfigured:

service:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extensions:
site: "datadoghq.com"
deployment_type: daemonset
hostname: test-host
installation_method: ""

service:
extensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extensions:
site: "datadoghq.com"
deployment_type: gateway
hostname: test-host
installation_method: ""

service:
extensions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
api_key: ggggg77777
otelcollector:
converter:
features: [pprof, zpages, health_check, datadog]
features: [pprof, zpages, health_check, datadog]
installation_method: bare-metal
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extensions:
site: "datadoghq.com"
deployment_type: daemonset
hostname: test-host
installation_method: "bare-metal"

service:
extensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extensions:
site: "us5.datadoghq.com"
deployment_type: daemonset
hostname: test-host
installation_method: ""

service:
extensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extensions:
site: "datadoghq.com"
deployment_type: daemonset
hostname: test-host
installation_method: ""

service:
extensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extensions:
site: "datadoghq.eu"
deployment_type: daemonset
hostname: test-host
installation_method: ""
ddflare/dd-autoconfigured:
health_check/dd-autoconfigured:
pprof/dd-autoconfigured:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extensions:
site: "datadoghq.eu"
deployment_type: daemonset
hostname: test-host
installation_method: ""
ddflare/dd-autoconfigured:
health_check/dd-autoconfigured:
pprof/dd-autoconfigured:
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,9 @@ replace github.com/iceber/iouring-go => github.com/lebauce/iouring-go v0.0.0-202
// Fork to remove some text/template usage, https://github.com/DataDog/opa/tree/lightweight-1.7.1
replace github.com/open-policy-agent/opa => github.com/DataDog/opa v0.0.0-20251126100856-d2e1e78e0816

// TODO: Remove this replace once v0.148.0 is released
replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/datadogextension v0.147.0 => github.com/DataDog/opentelemetry-collector-contrib/extension/datadogextension v0.147.1-0.20260319095942-6b90e15b61ca

// This section was automatically added by 'dda inv modules.add-all-replace' command, do not edit manually

replace (
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/config/setup/common_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ func initCoreAgentFull(config pkgconfigmodel.Setup) {
})
})
config.BindEnvAndSetDefault("otelcollector.gateway.mode", false)
config.BindEnvAndSetDefault("otelcollector.installation_method", "")

// inventories
config.BindEnvAndSetDefault("inventories_enabled", true)
Expand Down
27 changes: 27 additions & 0 deletions pkg/fleet/installer/packages/datadog_agent_ddot_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/DataDog/datadog-agent/pkg/util/winutil"

"golang.org/x/sys/windows"
"golang.org/x/sys/windows/registry"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/windows/svc/mgr"
)
Expand Down Expand Up @@ -204,6 +205,9 @@ func ensureDDOTService() error {
}
// Best-effort: align service DACL to allow the core Agent user to control OTEL service
configureDDOTServicePermissions(s)
if err := setDDOTServiceEnvVars(); err != nil {
return err
}
return nil
}

Expand All @@ -223,6 +227,9 @@ func ensureDDOTService() error {
}
// Best-effort: align service DACL to allow the core Agent user to control OTEL service
configureDDOTServicePermissions(s)
if err := setDDOTServiceEnvVars(); err != nil {
return err
}
return nil
}

Expand Down Expand Up @@ -337,6 +344,20 @@ func configureDDOTServicePermissions(s *mgr.Service) {
}
}

// setDDOTServiceEnvVars writes the DDOT service environment variables to the registry.
func setDDOTServiceEnvVars() error {
key, _, err := registry.CreateKey(
registry.LOCAL_MACHINE,
`SYSTEM\CurrentControlSet\Services\`+otelServiceName+`\Environment`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Write the Windows service Environment value on the service key

Our Windows service helper writes a service's environment as an Environment multi-string value directly on HKLM\SYSTEM\CurrentControlSet\Services\<name> (test/new-e2e/tests/windows/common/service.go:257-267), but this code creates a ...\Services\datadog-otel-agent\Environment subkey and writes that subkey's default value instead. In Windows installs that rely on this hook, the DDOT service will still start without DD_OTELCOLLECTOR_INSTALLATION_METHOD, so the new installation_method remains empty even though installation succeeds.

Useful? React with 👍 / 👎.

registry.SET_VALUE,
)
if err != nil {
return fmt.Errorf("failed to open service environment registry key: %w", err)
}
defer key.Close()
return key.SetStringsValue("", []string{"DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"})
}

// stopServiceIfExists stops the service if it exists
func stopServiceIfExists(name string) error {
// Use robust stop; ignore 'service does not exist'
Expand Down Expand Up @@ -481,6 +502,9 @@ func ensureDDOTServiceForExtension(binaryPath string) error {
return err
}
configureDDOTServicePermissions(s)
if err := setDDOTServiceEnvVars(); err != nil {
return err
}
return nil
}

Expand All @@ -498,5 +522,8 @@ func ensureDDOTServiceForExtension(binaryPath string) error {
return err
}
configureDDOTServicePermissions(s)
if err := setDDOTServiceEnvVars(); err != nil {
return err
}
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-{{.EtcDir}}/environment
Environment="DD_FLEET_POLICIES_DIR={{.FleetPoliciesDir}}"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
Comment thread
liustanley marked this conversation as resolved.
{{- if not .Stable}}
Environment="DD_INVENTORIES_FIRST_RUN_DELAY=5"
{{- end}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent-exp/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent-exp/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
Environment="DD_INVENTORIES_FIRST_RUN_DELAY=5"
ExecStart=/opt/datadog-agent/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent-exp/otel-config.yaml --core-config /etc/datadog-agent-exp/datadog.yaml --pidfile /opt/datadog-agent/run/otel-agent.pid
StartLimitInterval=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
ExecStart=/opt/datadog-agent/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent/otel-config.yaml --core-config /etc/datadog-agent/datadog.yaml --pidfile /opt/datadog-agent/run/otel-agent.pid
StartLimitInterval=10
StartLimitBurst=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent-exp/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent-exp/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
Environment="DD_INVENTORIES_FIRST_RUN_DELAY=5"
ExecStart=/opt/datadog-agent/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent-exp/otel-config.yaml --core-config /etc/datadog-agent-exp/datadog.yaml --pidfile /opt/datadog-agent/run/otel-agent.pid
StartLimitInterval=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
ExecStart=/opt/datadog-agent/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent/otel-config.yaml --core-config /etc/datadog-agent/datadog.yaml --pidfile /opt/datadog-agent/run/otel-agent.pid
StartLimitInterval=10
StartLimitBurst=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent-exp/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent-exp/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
Environment="DD_INVENTORIES_FIRST_RUN_DELAY=5"
ExecStart=/opt/datadog-packages/datadog-agent/experiment/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent-exp/otel-config.yaml --core-config /etc/datadog-agent-exp/datadog.yaml --pidfile /opt/datadog-packages/datadog-agent/experiment/run/otel-agent.pid
StartLimitInterval=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
ExecStart=/opt/datadog-packages/datadog-agent/stable/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent/otel-config.yaml --core-config /etc/datadog-agent/datadog.yaml --pidfile /opt/datadog-packages/datadog-agent/stable/run/otel-agent.pid
StartLimitInterval=10
StartLimitBurst=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent-exp/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent-exp/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
Environment="DD_INVENTORIES_FIRST_RUN_DELAY=5"
ExecStart=/opt/datadog-packages/datadog-agent/experiment/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent-exp/otel-config.yaml --core-config /etc/datadog-agent-exp/datadog.yaml --pidfile /opt/datadog-packages/datadog-agent/experiment/run/otel-agent.pid
StartLimitInterval=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Restart=on-failure
RestartSec=2
EnvironmentFile=-/etc/datadog-agent/environment
Environment="DD_FLEET_POLICIES_DIR=/etc/datadog-agent/managed/datadog-agent/stable"
Environment="DD_OTELCOLLECTOR_INSTALLATION_METHOD=bare-metal"
ExecStart=/opt/datadog-packages/datadog-agent/stable/ext/ddot/embedded/bin/otel-agent run --config /etc/datadog-agent/otel-config.yaml --core-config /etc/datadog-agent/datadog.yaml --pidfile /opt/datadog-packages/datadog-agent/stable/run/otel-agent.pid
StartLimitInterval=10
StartLimitBurst=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ extensions:
deployment_type: daemonset
force_attempt_http2: true
hostname: ""
installation_method: "" # TODO: change to "helm" after helm chart version bump
http:
cors: null
endpoint: localhost:9875
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ extensions:
deployment_type: daemonset
force_attempt_http2: true
hostname: ""
installation_method: "" # TODO: change to "helm" after helm chart version bump
http:
cors: null
endpoint: localhost:9875
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extensions:
deployment_type: daemonset
force_attempt_http2: true
hostname: ""
installation_method: "" # TODO: change to "helm" after helm chart version bump
http:
cors: null
endpoint: localhost:9875
Expand Down
Loading