Search code examples
containersamazon-ecsprometheus

How to implement service discovery in AWS ECS?


I'm planning to use Promethus in ECS Cluster for monitoring but seems that Promethus does not support ECS service discovery in native, unlike EC2.

I'm searching but not enough information. I would really appreciate if any share any information. Thanks in advance.


Solution

  • I'm quite not sure, if i understood the problem correctly.

    You can create private hosted zone in Route 53 and configure it to a particular VPC with DNSresolution and DNS Hostname enabled.

    with this, you can create an ECS instances with the above set VPC, create a service with task having a name say promotheus.local or your application (app.local) to which you want to monitor from promotheus, with this kind of set up, you can use http://app.local:port to extract monitoring information by name instead of private IP.

    Ref: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zone-private-considerations.html

    Hope this helps.

    Thanks, Sridhar