# Heroku

## Prerequisites

* [connect your datadog account to Nimbus](https://docs.nimbus.dev/overview/quickstart#1-connect-your-datadog-account)

## Steps

### 1. Add your Nimbus Endpoint as a Log Drain

```sh
heroku drains:add "https://$YOUR_NIMBUS_ENDPOINT?dd-api-key=<DD_API_KEY>&ddsource=heroku&env=<ENV>&service=<SERVICE>&host=<HOST>" -a <APPLICATION_NAME>
```

### 2. Add custom attributes (optional)

You can add custom attributes by appending it to the end of your drain query string

```sh
heroku drains:add "https://$YOUR_NIMBUS_ENDPOINT?dd-api-key=<DD_API_KEY>&ddsource=heroku&env=<ENV>&service=<SERVICE>&host=<HOST>&<attKey>=<attValue>" -a <APPLICATION_NAME>
```

### 3. Confirm receiving logs

Verify via the datadog log console that logs are coming in with the expected attributes

### 4. Remove your old endpoint

```sh
heroku drains:remove <id-of-dd-drain>
```
