Datadog Agent for EC2

Install Datadog Agent

Run the following command on the EC2 instance. It starts collecting and reporting metrics on CPU, memory, network, and uptime for the ec2 instance itself.

Replace the placeholder <dns> with the correct endpoint name.

Basic Installation
DD_UPGRADE=true DD_API_KEY=kloudfuse  DD_URL="https://<KFUSE-DNS>/ingester" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"

Configure Metric Collection

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.

Collect OpenMetrics
cp /etc/datadog-agent/conf.d/openmetrics.d/conf.yaml.example /etc/datadog-agent/conf.d/openmetrics.d/conf.yaml

For more examples, see Datadog documentation on OpenMetrics.

Collect Logs

Edit your /etc/datadog-agent/datadog.yaml file to collect logs.

Collect logs
logs_enabled: true

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.

Get Kloudfuse and Datadog Logs

For Dual Shipping, use the following configuration:

Dual Shipping Logs for Datadog and Kloudfuse
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