Is there a way to run a command via fly ssh against all app instances?

I was thinking it could be something on these lines. May I suggest you use health checks?

https://fly.io/docs/reference/configuration/#the-checks-section

The tl;dr: you can create a route that replies with plain text with the infos you’d want to know and it would be available under your app Monitoring Page and fly checks list. We been doing work improving those (see Health check history on Monitoring Page) and we even use this for customers postgres to show useful data like status for each node. Here’s how it looks like from another post

If you also happen to need to collect those checks you can do so by the machines list API endpoint (assuming you use machines, they’re awesome).

Let me know if these might fix your use case.

1 Like