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"
powershell

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"
powershell

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
yaml
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
yaml

After making configuration changes, restart the Datadog Agent service:

Restart-Service -Name datadogagent
powershell

Collect Events

Edit C:\ProgramData\Datadog\datadog.yaml to enable event collection:

collect_events: true
yaml

Restart the agent after making changes:

Restart-Service -Name datadogagent
powershell

Collect Traces

  1. Enable APM in C:\ProgramData\Datadog\datadog.yaml:

    apm_config:
      enabled: true
      apm_dd_url: "https://<kloudfuse-hostname>/ingester"
    yaml
  2. Restart the agent:

    Restart-Service -Name datadogagent
    powershell
  3. Instrument your application with the Datadog APM library for your language (dd-trace for Python, ddtrace for 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

  1. Confirm the agent service is running:

    Get-Service -Name datadogagent
    powershell

    The Status column should show Running.

  2. Check the agent status for active checks and any errors:

    & "C:\Program Files\Datadog\Datadog Agent\bin\agent.exe" status
    powershell
  3. 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.

  4. To confirm metrics are flowing, open Metrics Explorer, search for system.cpu.user, and filter by host:<hostname>.

Troubleshooting

Agent Service Not Starting

If Get-Service -Name datadogagent shows Stopped or the agent fails to start:

  1. Check the Windows Event Log for errors from the DatadogAgent source:

    Get-EventLog -LogName Application -Source DatadogAgent -Newest 20
    powershell
  2. Validate the configuration file syntax:

    & "C:\Program Files\Datadog\Datadog Agent\bin\agent.exe" check
    powershell
  3. Confirm C:\ProgramData\Datadog\datadog.yaml has 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:

  1. Confirm the DD_URL used during installation points to your Kloudfuse cluster:

    Select-String -Path "C:\ProgramData\Datadog\datadog.yaml" -Pattern "dd_url"
    powershell
  2. Check the agent’s network connectivity to the Kloudfuse ingester:

    Test-NetConnection -ComputerName <kloudfuse-hostname> -Port 443
    powershell
  3. Inspect the agent log for outbound connection errors:

    Get-Content "C:\ProgramData\Datadog\logs\agent.log" -Tail 50 | Select-String "error"
    powershell