# Heroku integration

## Start logging in 2 minutes

### 1. Install

Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).

### 2. Login

Log in to Heroku:

```sh
[label Run Heroku Login]
heroku login
```

### 3. Setup

Set up Better Stack drain to Heroku:

```sh
[label Add Heroku drain]
heroku drains:add \
    "https://$INGESTING_HOST_VEC:6515/events?source_token=$SOURCE_TOKEN" \
    -a $HEROKU_APP_SLUG
```

[info]
#### Insert your Heroku details

You will need to replace `$HEROKU_APP_SLUG` in the command above. The application slug is the name of the application in Heroku. You can see your available apps in the [Heroku dashboard](https://dashboard.heroku.com/apps).
[/info]

### 4. Start logging 🎉

You should see your logs in [Better Stack → Live tail](https://telemetry.betterstack.com/team/0/tail ";_blank").

Check out your metrics in the [Heroku dashboard](https://telemetry.betterstack.com/team/0/dashboards/platform/heroku ";_blank").

## Enable metrics

Enable [Heroku Runtime Metrics](https://devcenter.heroku.com/articles/log-runtime-metrics) to take full advantage of our [Heroku dashboard](https://telemetry.betterstack.com/team/0/dashboards/platform/heroku ";_blank").

Use Heroku CLI to set up metrics for your app: 

```sh
[label Enable Heroku metrics]
heroku labs:enable log-runtime-metrics --app $HEROKU_APP_SLUG
heroku restart --app $HEROKU_APP_SLUG
```
[info]
#### Insert your Heroku details

You will need to replace `$HEROKU_APP_SLUG` in the commands above. The application slug is the name of the application in Heroku. You can see your available apps in the [Heroku dashboard](https://dashboard.heroku.com/apps).
[/info]

Check out your metrics in the [Heroku dashboard](https://telemetry.betterstack.com/team/0/dashboards/platform/heroku ";_blank").


## Need help?

Please let us know at hello@betterstack.com.  
We're happy to help! 🙏

## Additional resources

Interested in learning more about **Better Stack Heroku add-on** and **best practices** for logging in Heroku?
Check out our [Complete Guide to Logging in Heroku](https://betterstack.com/community/guides/logging/how-to-start-logging-with-heroku/). 