Fly.io logs
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.io | In Flowhawk |
|---|---|
fly.app.name | The service |
| Region and machine | Attributes on each line, to filter one region |
| A JSON log line from your app | Its 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.
Related
Railway logsForward the logs of your Railway services to Flowhawk with Locomotive, Railway's log forwarder template.
Heroku log drainSend the logs of a Heroku app to Flowhawk with one HTTPS drain.
OpenTelemetry for Express and Node.jsTrace an Express, Fastify or NestJS app with OpenTelemetry, and send it to Flowhawk with one flag or one line.