Guides · Fly.io
Count every Fly.io deploy with a curl from your deploy step
Fly.io has no outgoing webhooks, so nothing in the Fly dashboard can call a URL for you. The honest route is a curl right after fly deploy in whatever runs it, or a small Machine on a schedule, and EventBar counts each one.
Needs: the free EventBar app on your Mac, an EventBar account, and a Fly.io account with permission to add webhooks. About five minutes. Generic JSON.
Steps
- Create the webhook URL. In the EventBar dashboard, open the Webhooks tab, pick the group this belongs to (one group per site or app is the usual shape), choose the provider Generic JSON, name it, and press Create. Copy the URL; it stays visible and can be rotated any time.
- Paste it into Fly.io. There is no webhook screen in Fly.io. Wherever you run
fly deploy, a CI job, a Makefile, your own shell, add one line after it:curl -sS -X POST -H "content-type: application/json" -d '{"event":"deploy","app":"my-app","status":"ok"}' "$EVENTBAR_HOOK". Put the hook URL inEVENTBAR_HOOKas a CI secret or a Fly secret, never in the repo. Create the EventBar hook as Generic JSON with type fieldevent. - Trigger one. Most services offer a test delivery; otherwise do the real thing once. It shows up in the dashboard's Events tab within a second and in the menu bar, as an undefined type named after the event. That first one is your proof the wiring works.
- Make it read well. Press Define on the new type and give it a title and a body template. Fields come from the payload, nested ones with dots. The table below is a starting point.
What you'll see
| Type | Title | Body template |
|---|---|---|
deploy | Deployed | {app} · {status} |
deploy_failed | Deploy failed | {app} |
cron | Scheduled job | {app} · {job} |
Every type has its own switch in the menu bar, so a noisy one can be quiet on this Mac and still counted. Counts cover the last hour, 24 hours, 7 days, 30 days and all time.
Worth knowing
- These field names are yours, not Fly's: the POST carries whatever you put in
-d. Sendeventasdeploy_failedfrom the failure branch (fly deploy || curl …) and the two outcomes get separate switches. - For a scheduled job, a Machine started with
fly machine run … --schedule hourlythat ends with the samecurlis a heartbeat: when the count stops moving, the job stopped. - If the version matters, add
"version":"$(git rev-parse --short HEAD)"to the body and{version}to the template.
The full contract, including how each preset reads a payload and what the answers mean, is in the API docs. Something about Fly.io's payload changed? Tell us and we'll fix the guide.