Ingest Metrics from Datadog© Agent

You can bring metrics to Middleware even if your infrastructure is running Datadog agents. Middleware platform can completely replace Datadog for metrics ingestion without replacing Datadog agents. You just have to update configuration in the Datadog agent’s configuration file or environment variables.

Sections below describe how you can configure Datadog agents to send metrics to Middleware for Linux, Docker and Kubernetes environment.

Requirements

  • Middleware supports Datadog agent version 6 and 7. Version 5 and below are not supported.
  • Middleware supports Datadog API version 1 and 2. You can send metrics using either API version from the Datadog agent.
  • You will need a Middleware API key which can be found within the Installation section once you log into your Middleware account

Linux Environment

On the host running the Datadog agent, you will need to update the configuration file that is usually located at /etc/datadog-agent/datadog.yaml with the following configuration

#########################
## Basic Configuration ##
#########################

api_key: <MW_API_KEY>
dd_url: https://<account-id>.middleware.io/datadog

You will need to update above configuration with your API key. <account-id> is the part of the URL after https:// and before middleware.io once you log into your Middleware account.

After you update the datadog.yaml file, restart the Datadog agent to start sending metrics to Middleware.

Docker Environment

If you are using Dockerized version of the Datadog agent, you can pass in the required configuration using environment variables as show below

docker run -d --cgroupns host --pid host --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e DD_API_KEY=<MW_API_KEY> DD_URL=https://<account-id>.middleware.io/datadog gcr.io/datadoghq/agent:7

Kubernetes Environment

If you have deployed the Datadog Agent on Kubernetes using the Datadog Operator, you will need to update the api_key in the datadog-secret secret object on your cluster. You should update this value with your Middleware API key.

One way to update this value is by using following command assuming datadog-secrets secret is in the default namespace. Adjust namespace accordingly if your datadog-secrets is in a different namespace.

kubectl edit secret datadog-secrets -n default

Then update the api_key value with your Middleware API key, save the file and exit.

v1
data:
  api-key: <MW_API_KEY>
kind: Secret
metadata:
  creationTimestamp: "2023-07-03T20:14:13Z"
  name: datadog-secret
  namespace: default
  resourceVersion: "185954"
  uid: 492ef9a5-7eb3-424b-80db-846b6368aee9
type: Opaque

After you update the api_key, create a file called datadog.yaml with the following contents

kind: DatadogAgent
apiVersion: datadoghq.com/v2alpha1
metadata:
  name: datadog
spec:
  global:
    endpoint: 
      url: https://<account-id>.middleware.io/datadog 
    credentials:
      apiSecret:
        secretName: datadog-secret
        keyName: api-key
  override:
    clusterAgent:
      image:
        name: gcr.io/datadoghq/cluster-agent:latest
    nodeAgent:
      image:
        name: gcr.io/datadoghq/agent:latest

Use your <account-id> in the global.endpoint section of the spec. After you create this file, submit this file using following commands

kubectl apply -f datadog.yaml

Once you do this, your Kubernetes enviroment will start sending metrics to Middleware instead of Datadog.

Dashboard Builder

You can configure custom dashboards for metrics sent by the Datadog agent in the Dashboard Builder section of the Middleware website.