> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squasher.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Heroku

> Receive errors from Heroku applications via log drains. Zero-code setup.

## Overview

Heroku log drains forward your application's stdout/stderr to Squasher over HTTPS. Squasher detects error patterns and groups them with AI triage automatically.

No SDK, no code changes, no redeployment required.

If you use the Log Connectors screen in Squasher, create the Heroku connector first and copy the managed endpoint and ingest key from there. The manual URL below uses the same drain destination shape.

## Setup

<Steps>
  <Step title="Install the Heroku CLI">
    If you haven't already, install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).
  </Step>

  <Step title="Add the Squasher drain">
    ```bash theme={null}
    heroku drains:add \
      "https://ingest.squasher.ai/v1/drain/heroku/YOUR_PROJECT_ID?key=sq_pk_your_api_key" \
      -a your-heroku-app
    ```

    Replace `YOUR_PROJECT_ID` with your Squasher project ID and `your-heroku-app` with your Heroku app name.
  </Step>

  <Step title="Verify">
    Trigger an error in your app. Within seconds, it appears in your Squasher dashboard.

    Check the drain is working:

    ```bash theme={null}
    heroku drains -a your-heroku-app
    ```
  </Step>
</Steps>

## What Gets Captured

Squasher ingests all Heroku log lines but only creates error groups from:

* Lines with severity `error`, `fatal`, `critical`, or `err`
* Lines containing error indicators: `Error`, `Exception`, `panic`, `fatal`, `SIGKILL`
* Heroku platform errors (H10, H12, H13, H14, R14, etc.)

All other log lines are stored for context to enrich AI triage.

## Heroku Log Format

Heroku log drains forward syslog-framed messages. Squasher parses the standard Heroku log format:

```
<priority>version timestamp hostname app[process]: message
```

| Field              | Maps To                                   |
| ------------------ | ----------------------------------------- |
| `timestamp`        | Event timestamp                           |
| `app[process]`     | `tags.process` (e.g. `web.1`, `worker.1`) |
| `message`          | Log message                               |
| Heroku error codes | `error_type` (e.g. `H12`, `R14`)          |

## Combining with SDK

Use both a log drain and an SDK for maximum coverage:

* **Log drain** catches infrastructure errors (OOM kills, dyno crashes, routing errors)
* **SDK** provides rich context (stack traces, breadcrumbs, user info)

Squasher deduplicates by fingerprint, so the same error won't be counted twice.

## Agent handoff

```text theme={null}
Set up a Heroku log drain for Squasher project <project_id>. Prefer a managed connector endpoint, add the drain to one app first, verify with heroku drains and one test error, and ask before removing any existing drain.
```
