Here's how to run a DataDog Agent in a Docker container alongside Home Assistant on a Raspberry Pi, as an add-on.
Create a folder for the add-on on the Pi:
```
mkdir -p /addons/datadog_agent
```
In that folder, you'll need 3 files:
/addons/datadog_agent/Dockerfile
```
ARG BUILD_FROM
FROM $BUILD_FROM
```
/addons/datadog_agent/build.yaml
```
build_from:
amd64: datadog/agent
aarch64: datadog/agent
```
I'm suspecting that the **aarch64** entry alone would be enough for Raspberry Pi, but the **amd64** one doesn't hurt anyways.
/addons/datadog_agent/config.yaml
```
name: "DataDog Agent"
description: "DataDog Agent Add-on"
version: "1.0.0"
slug: "datadog_agent"
init: true
arch:
- aarch64
- amd64
environment:
DD_API_KEY: **<PLUG YOUR DataDog API KEY HERE>**
DD_SITE: us5.datadoghq.com <== REPLACE WITH YOUR DataDog DOMAIN
DD_HOSTNAME: homeassistant.local <== HOSTNAME YOU WANT DD AGENT TO LISTEN AT
DD_DOGSTATSD_NON_LOCAL_TRAFFIC: "true"
ports:
5000/tcp: 5000
5001/tcp: 5001
5002/tcp: 5002
8125/udp: 8125
```
Once all this is in place, you should be able to go to **Settings > Add-ons** in HA, and install/run the add-on from there.
#home-assistant #datadog