Fly.io logs

Ship the logs of every app in a Fly.io organization to Flowhawk with Fly's own log shipper.

Fly.io doesn't keep logs for long. fly-log-shipper is a small app Fly publishes that reads your organization's log stream and forwards it. Point its HTTP sink at Flowhawk.

What you get

  • Fly.io logs in Logs, next to your traces and metrics, searchable with the same query language (severity>=WARN service=checkout "timeout"), grouped into patterns or followed live.
  • A log line that names a request path joins the business flow of that route, so a failing checkout shows its platform logs on the checkout flow's page.
  • A line that carries a trace id opens its trace.
  • Alert on any search with Alert on this, and let the agent read these logs when it investigates an incident.

Set it up

First create an ingest key: in the app, open Settings > API keys and pick Services. In the examples below, KEY stands for that key. Keep it out of your repository, like any other secret.

fly launch --image ghcr.io/superfly/fly-log-shipper:latest --name my-log-shipper --no-deploy
fly secrets set ORG=personal ACCESS_TOKEN=$(fly tokens create readonly personal) \
  HTTP_URL=https://api.flowhawk.dev/v1/logs/fly HTTP_TOKEN=KEY -a my-log-shipper
fly deploy -a my-log-shipper

Replace personal with your organization's slug. One shipper covers every app in the organization.

The same steps, with your workspace's address filled in, are in the app under Settings > Integrations > Log drains.

What arrives

Fly.ioIn Flowhawk
fly.app.nameThe service
Region and machineAttributes on each line, to filter one region
A JSON log line from your appIts message, level, trace id and fields

Common questions

Can I name the service myself?

Add ?service=name to HTTP_URL. Every line from that shipper then goes to that one service, so use it only when the shipper serves one app.