awslabs / fargatecli

CLI for AWS Fargate
Apache License 2.0
893 stars 114 forks source link

Enable X-Ray integration #47

Open arun-gupta opened 6 years ago

arun-gupta commented 6 years ago

Until sidecar containers are supported, or even after they're supported, it would be useful to enable X-Ray integration using a flag. This could be something during service create command.

dougtoppin commented 4 years ago

@arun-gupta I do this now by adding the x-ray agent to the app container that I'm running. It and the app are started by running a script when the container starts like this:

#!/bin/sh

# run the x-ray agent in the background and in local mode ( -o  ) to prevent
# the getting container instance metadata error
/usr/bin/xray -t 0.0.0.0:2000 -b 0.0.0.0:2000 -o --config /cfg.yaml &

# run the demo app in the foreground
exec /app.py

The Dockerfile defines the startup script like this:

ENTRYPOINT ["/startup.sh"]

This works well for me so far.