using `flyctl machine` for ephemeral telemetry data capture

I’m looking to “boot up a virtual machine” that has a batch of useful
command line tools installed for network debugging. The nominal
use case involves capturing traceroute or mtr data from a
set of machines around the fly.io network all aimed at a single
target device that’s under test. The thought is that I could leverage
fly to spin something up temporarily each of many locations, collect some
telemetry, then shut down. Collating the results is left as an exercise to the
reader.

for n in (ord yyz ams)
do
     ssh telemetry-server-$n "sudo mtr -r -c 2 $MTR_TARGET"
done

What I want to do here looks like it needs to be done with flyctl machine
instead of an app, because I need the scale-to-zero aspects of it more
than anything else. The machine will blip into existence for maybe a minute
tops before it reports results and then goes away.

What does concern me a little is address allocation -
if I need to wink a globally routable IPv4 address into existence for a minute,
and then take it offline, the only pricing I see is at the $2/mo monthly level.
That’s perfectly reasonable but also not a great fit for this one-off setup
across many data centers.

You can consider invoking the machine with flyctl m start (docs) instead of over public IP?

Alternatively, it must also be possible to wake the machine up over 6pn (docs): Fly Apps on machines: prerelease of fly deploy - #8 by kurt

You should be able to take advantage of a shared IPv4 for times when you need to access the App (assuming the request fits the requirements of shared IPs).

I think machines line up well with what you seem to be wanting to do. With machines, the App is a shell to contain resources (machines, volumes, IPs, etc.) versus a full fledge resource backed by Nomad. Everything flyctl machine does is backed by an API that you can also use directly.