title: Prometheus metrics scraping of docker tasks in ECS
body: <p>I have multiple clusters in ECS, each cluster has multiple services, each service runs more than 1 task. Each task exposes <code>/metrics</code> with different values, on random port. I'd like to do some kind of dynamic discovery and scrape those metrics (each task has different port and different IP, because they run on multiple container instances), group together tasks' metrics from same service and scrape them using prometheus. How should I do that?</p>