aws-microservices-deploy-options icon indicating copy to clipboard operation
aws-microservices-deploy-options copied to clipboard

Add X-Ray integration with Fargate and ECS

Open arun-gupta opened this issue 6 years ago • 9 comments

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

arun-gupta avatar Mar 08 '18 21:03 arun-gupta

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

arun-gupta avatar Apr 02 '18 20:04 arun-gupta

/assign @tiffanyfj

arun-gupta avatar Apr 15 '18 23:04 arun-gupta

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

jicowan avatar May 15 '18 18:05 jicowan

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

arun-gupta avatar May 15 '18 22:05 arun-gupta

@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.

ghost avatar Mar 09 '20 22:03 ghost

@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.

jicowan avatar Mar 10 '20 18:03 jicowan

@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.

ghost avatar Mar 10 '20 18:03 ghost

@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.

albertocorrales avatar Apr 09 '20 14:04 albertocorrales

@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.

ghost avatar Apr 09 '20 15:04 ghost