Datadog Agent for Windows
The Datadog Agent for Windows is a lightweight software component that collects metrics, logs, and traces from your Windows infrastructure and sends them to Datadog for analysis and visualization. It enables you to monitor system performance, application health, and custom metrics across your Windows environments. The agent runs as a service on Windows hosts and can be configured to collect data from various sources including the operating system, applications, and integrations.
Install Datadog Agent
Run the following command in PowerShell with administrator privileges on the Windows host instance. It starts collecting and reporting metrics on CPU, memory, network, and uptime for the host instance.
Replace the placeholder <KFUSE-DNS> with the correct endpoint name.
$env:DD_UPGRADE="true"
$env:DD_API_KEY="kloudfuse"
$env:DD_URL="https://<KFUSE-DNS>/ingester"
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 enabling checks, such as OpenMetrics check, you can direct Datadog to collect additional metrics.
Copy the following example into your conf.yaml file in the openmetrics.d directory.
Copy-Item "C:\ProgramData\Datadog\conf.d\openmetrics.d\conf.yaml.example" `
"C:\ProgramData\Datadog\conf.d\openmetrics.d\conf.yaml"
For more examples, see Datadog documentation on OpenMetrics.
Collect Logs
Edit your C:\ProgramData\Datadog\datadog.yaml file to collect logs.
additional_endpoints:
"https://<KFUSE-DNS>/ingester":
- apikey1
logs_enabled: true
metadata_providers:
- name: host
interval: 300
use_v2_api:
series: true
enable_payloads:
events: false
series: false
service_checks: false
sketches: false
process_config:
expvar_port: 0
cmd_port: 0
logs_config:
logs_dd_url: <KFUSE-DNS>:443
logs_no_ssl: false
force_use_http: true
use_compression: true
use_v2_api: false
|
Starting with v6.19+/v7.19+, Datadog uses HTTPS transport; see Datadog documentation on https://docs.datadoghq.com/agent/logs/log_transport/?tab=https [Agent Transport for Logs,role=external,window=_blank]. |
Add Source Files
To add source files for collection, see Datadog documentation of Custom log collection.
You must specify the start_position setting in the custom conf.yaml file if you are tailing custom files, to ensure that you receive all the data and not just the "live" data.
Restart Datadog Agent Service
After making configuration changes, restart the Datadog Agent service:
Restart-Service -Name datadogagent
Get Kloudfuse and Datadog Logs
For Dual Shipping, use the following configuration:
logs_enabled: true
logs_config:
logs_dd_url: <DATADOG_DNS>:443
logs_no_ssl: false
force_use_http: true
use_compression: true
use_v2_api: false
additional_endpoints:
- api_key: apikey1
Host: "<KFUSE-DNS>"
Port: 443
use_compression: true
use_http: true
use_v2_api: false
Collect Events
Edit your C:\ProgramData\Datadog\datadog.yaml file to collect events.
Be sure to enable the collect_events option. If this option is missing or set to false, you need to enable it.
Use this configuration to enable the collection of Windows events and system events (such as service status changes or system changes).
collect_events: true
After making configuration changes, restart the Datadog Agent service:
Restart-Service -Name datadogagent
Collect Traces
To collect traces from applications running on Windows, configure the Datadog Agent to interact with OpenTracing or OpenTelemetry instrumented applications.
-
Open the
C:\ProgramData\Datadog\datadog.yamlfile and set theapm_configtotrue:apm_config: enabled: trueyaml -
Restart the Datadog Agent service to apply the changes:
Restart-Service -Name datadogagentpowershell -
For each application, instrument your applications with Datadog’s APM (Application Performance Monitoring).
Simply add the Datadog APM libraries to your application —
dd-tracefor Python,ddtracefor Java, and so on. -
Enable the Datadog APM agent by setting environment variables for your application:
$env:DD_AGENT_HOST="localhost" $env:DD_TRACE_ENABLED="true" $env:DD_ENV="<YOUR_ENV_NAME>" # e.g., "production" $env:DD_SERVICE="<YOUR_SERVICE_NAME>" # e.g., "web-app" $env:DD_VERSION="<YOUR_SERVICE_VERSION>"powershell