Windows Integration
The agent runs as a Windows service and can immediately collect metrics from the Windows System.
Overview
The Datadog Agent on Windows runs as a background service (DatadogAgent) and collects host-level metrics (CPU, memory, disk, network), Windows Event Log entries, custom log files, and application traces.
The agent is configured through C:\ProgramData\Datadog\datadog.yaml and per-integration YAML files in C:\ProgramData\Datadog\conf.d\.
Changes to any configuration file require restarting the datadogagent service.
Install the Datadog Agent
Run the following in PowerShell with administrator privileges.
Replace <kloudfuse-hostname> with your Kloudfuse cluster hostname.
$env:DD_UPGRADE="true"
$env:DD_API_KEY="kloudfuse"
$env:DD_URL="https://<kloudfuse-hostname>"
Start-BitsTransfer -Source "https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-7-latest.amd64.msi" -Destination "$env:TEMP\datadog-agent-7-latest.amd64.msi"
Start-Process msiexec.exe -Wait -ArgumentList "/qn /i $env:TEMP\datadog-agent-7-latest.amd64.msi APIKEY=$env:DD_API_KEY DD_URL=$env:DD_URL"
Collect Metrics
By default, the agent collects system metrics (CPU, memory, disk, network). To collect additional application metrics via the OpenMetrics check, copy the example configuration:
Copy-Item "C:\ProgramData\Datadog\conf.d\openmetrics.d\conf.yaml.example" `
"C:\ProgramData\Datadog\conf.d\openmetrics.d\conf.yaml"
See Datadog — OpenMetrics Integration for configuration options.
Collect Logs
Edit C:\ProgramData\Datadog\datadog.yaml to enable log collection and point the log endpoint at Kloudfuse:
logs_enabled: true
logs_config:
logs_dd_url: https://<kloudfuse-hostname>
logs_no_ssl: false
use_http: true
use_v2_api: false
| Starting with Datadog Agent v6.19+/v7.19+, the agent uses HTTPS transport for logs by default. See Agent Transport for Logs. |
Collect Custom Log Files
To tail custom log files, see Datadog — Custom Log Collection.
Set start_position: beginning in the custom conf.yaml to ensure you receive all historical data, not just new log lines.
Dual Ship to Kloudfuse and Datadog
To send logs to both Datadog and Kloudfuse simultaneously:
logs_enabled: true
logs_config:
logs_dd_url: https://<kloudfuse-hostname>
logs_no_ssl: false
use_http: true
use_v2_api: false
additional_endpoints:
- api_key: <api_key>
Host: "<kloudfuse-hostname>"
Port: 443
use_compression: true
use_http: true
use_v2_api: false
After making configuration changes, restart the Datadog Agent service:
Restart-Service -Name datadogagent
Collect Events
Edit C:\ProgramData\Datadog\datadog.yaml to enable event collection:
collect_events: true
Restart the agent after making changes:
Restart-Service -Name datadogagent
Collect Traces
-
Enable APM in
C:\ProgramData\Datadog\datadog.yaml:apm_config: enabled: true apm_dd_url: "https://<kloudfuse-hostname>/ingester"yaml -
Restart the agent:
Restart-Service -Name datadogagentpowershell -
Instrument your application with the Datadog APM library for your language (
dd-tracefor Python,ddtracefor Java, etc.) and set the following environment variables:$env:DD_AGENT_HOST="localhost" $env:DD_TRACE_ENABLED="true" $env:DD_ENV="production" $env:DD_SERVICE="my-service" $env:DD_VERSION="1.0.0"powershell
Verify Metrics Are Arriving
-
Confirm the agent service is running:
Get-Service -Name datadogagentpowershellThe
Statuscolumn should showRunning. -
Check the agent status for active checks and any errors:
& "C:\Program Files\Datadog\Datadog Agent\bin\agent.exe" statuspowershell -
In the Kloudfuse UI, click Infrastructure in the top navigation, then select Hosts. Your Windows host (identified by its hostname) should appear within a few minutes of the agent starting.
-
To confirm metrics are flowing, open Metrics Explorer, search for
system.cpu.user, and filter byhost:<hostname>.
Troubleshooting
Agent Service Not Starting
If Get-Service -Name datadogagent shows Stopped or the agent fails to start:
-
Check the Windows Event Log for errors from the
DatadogAgentsource:Get-EventLog -LogName Application -Source DatadogAgent -Newest 20powershell -
Validate the configuration file syntax:
& "C:\Program Files\Datadog\Datadog Agent\bin\agent.exe" checkpowershell -
Confirm
C:\ProgramData\Datadog\datadog.yamlhas correct YAML syntax — YAML is indentation-sensitive and Windows line endings (CRLF) can sometimes cause parse errors if the file was edited with a tool that mixed line endings.
Metrics Not Appearing in Kloudfuse
If the service is running but no metrics appear:
-
Confirm the
DD_URLused during installation points to your Kloudfuse cluster:Select-String -Path "C:\ProgramData\Datadog\datadog.yaml" -Pattern "dd_url"powershell -
Check the agent’s network connectivity to the Kloudfuse ingester:
Test-NetConnection -ComputerName <kloudfuse-hostname> -Port 443powershell -
Inspect the agent log for outbound connection errors:
Get-Content "C:\ProgramData\Datadog\logs\agent.log" -Tail 50 | Select-String "error"powershell