I had trouble figuring out how to configure Prometheus EC2 instances discovery once, so I'm sharing this gist that includes some sample config that worked fine for me with Prometheus v2.17.2!
- You should of course start by reading the official documentation
- But at the time of writing, it was incomplete or misleading; the author seems to know but does not seem to care though.
- Also, make sure to use a recent version of Prometheus.
- If nothing works, well, you can have a look at the source code.
Good luck!