aws-samples / aws-microservices-deploy-options

This repo contains a simple application that consists of three microservices. Each application is deployed using different Compute options on AWS.
MIT No Attribution
427 stars 179 forks source link

Add X-Ray integration with Fargate and ECS #55

Open arun-gupta opened 6 years ago

arun-gupta commented 6 years ago

Show how X-Ray can be enabled and used for distributed monitoring of an application deployed on Fargate and ECS

arun-gupta commented 6 years ago

https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-ecs.html

arun-gupta commented 6 years ago

/assign @tiffanyfj

jicowan commented 6 years ago

@arun-gupta I have working example of this here, https://github.com/aws-samples/aws-xray-fargate.

arun-gupta commented 6 years ago

Thanks @jicowan, will try it out and then close!

ghost commented 4 years ago

@jicowan could you please explain how to set up health checks? I have now spent over 3 days trying to spin up X-Ray Daemon on Fargate without any avail. Apart from your repo there is pretty much no information available to use as a reference.

jicowan commented 4 years ago

@IrmantasM EKS Fargate or ECS Fargate? I didn't configure a healthcheck in my example. Since the X-Ray agent is not exposed as a service, I think you will need to create a Docker healthcheck, https://docs.docker.com/engine/reference/builder/#healthcheck.

ghost commented 4 years ago

@jicowan hey, sorry, I should have mentioned, completely forgot that EKS Fargate is a thing! In my case it's ECS Fargatee.

However, I finally managed to get it to run in "stable" state running as an independent service. I ended up spinning up an nginx container as a sidecar for X-Ray Daemon and used it as a health check endpoint. Next step is to attempt to send data from other services to the daemon service.

albertocorrales commented 4 years ago

@jicowan hey, sorry, I should have mentioned, completely forgot that EKS Fargate is a thing! In my case it's ECS Fargatee.

However, I finally managed to get it to run in "stable" state running as an independent service. I ended up spinning up an nginx container as a sidecar for X-Ray Daemon and used it as a health check endpoint. Next step is to attempt to send data from other services to the daemon service.

Did you manage t do this? having only one shared daemon seems a good option, instead of having one per cluster. If you could provide a small tutorial for this option it would be great.

ghost commented 4 years ago

@albertocorrales unfortunately I did not manage to do it, IIRC reason was because ALB only supports HTTP and HTTPS protocols and NLB doesn’t support UDP for ip target type.

Ended up running x-ray as a sidecar container on each service, so far it's working fine and doesn't seem to be a resource hog. It would be nice to know how much CPU/Memory should be allocated to the sidecar container.