> ## 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.

# Fly.io

> Receive errors from Fly.io applications via log shipping. Zero-code setup.

## Overview

Forward logs from your Fly.io apps to Squasher using Fly's built-in log shipping. Squasher detects errors and groups them with AI triage.

If you use the Log Connectors screen in Squasher, create the Fly.io connector first and copy the managed endpoint and ingest key from there. The manual setup below still maps to the same Squasher ingest path.

## Option 1: NATS Log Shipping (Recommended)

Use Fly's official [log shipper](https://github.com/superfly/fly-log-shipper) to forward logs to Squasher.

<Steps>
  <Step title="Launch the log shipper">
    ```bash theme={null}
    fly launch --no-deploy --image flyio/log-shipper:latest
    ```
  </Step>

  <Step title="Configure fly.toml">
    Replace the `[http_service]` section:

    ```toml theme={null}
    [[services]]
    http_checks = []
    internal_port = 8686
    ```
  </Step>

  <Step title="Set secrets">
    ```bash theme={null}
    ORG_SLUG=personal # or your org slug from `fly orgs list`
    fly secrets set ORG=$ORG_SLUG
    fly secrets set ACCESS_TOKEN=$(fly tokens create readonly $ORG_SLUG | cut -d' ' -f2)
    fly secrets set HTTP_URL=https://ingest.squasher.ai/v1/drain/flyio/YOUR_PROJECT_ID
    fly secrets set HTTP_TOKEN=sq_pk_your_api_key
    ```
  </Step>

  <Step title="Deploy">
    ```bash theme={null}
    fly deploy
    ```
  </Step>
</Steps>

## Option 2: Direct OTel Export

If your Fly app uses OpenTelemetry, point the exporter directly at Squasher:

```bash theme={null}
fly secrets set OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.squasher.ai
fly secrets set OTEL_EXPORTER_OTLP_HEADERS="x-squasher-key=sq_pk_your_api_key"
fly secrets set OTEL_SERVICE_NAME=my-fly-app
```

See language-specific setup in our [OpenTelemetry guide](/integrations/opentelemetry).

## What Gets Captured

Squasher detects errors using:

* Severity field: `error`, `fatal`, `critical`
* Message heuristics: lines containing `Error`, `Exception`, `panic`, `fatal`
* Application crash indicators from Fly's platform logs

All non-error entries are stored for AI triage context.

## Agent handoff

```text theme={null}
Set up Fly.io logs for Squasher project <project_id>. Prefer the managed connector endpoint, use read-only Fly tokens where possible, verify one error-level event, and ask before changing production log shipping or secrets.
```
