Warning
This was copypasta'd from an internal repo and may not work stand-alone. We'll work to make this the version we use too so that we know it works!
An ansible role that uses tailscale to generate an inventory of hosts to then render a prometheus config. Used by the Hachyderm team to automatically regenerate our prometheus configuration as our fleet changes.
tailscaleis installed, up, and thetailscalebinary is in your user's$PATHpromtoolis installed (it should be if prometheus is installed), and it's also available on your$PATH
You'll definetly want to update the prometheus.yml template to match your set up. In particular, you'll want the various scrape sections to match the architecture of your application, and this, in turn, should match how you're tagging hosts in Tailscale.
Here is a snippet of our tailscale configuration:
When we attach a machine to our tailnet, we attach the appropriate tags to the machine, like so:
