Please vote on this issue by adding a đź‘Ť reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Tell us about your request
Running workloads using AWS Batch with Fargate compute does not support Xray. Please add support for Xray / tracing in Batch Fargate.
Ideally we want an Active Tracing configuration support similar to Lambda where you can just enable without a lot of configuration.
Which service(s) is this request for?
Batch with Fargate Compute Environment
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
I am currently trying to enable and send Xray traces for a Batch workload running on Fargate compute but to no avail.
For ECS Fargate, we currently have the option to run the Xray daemon as a sidecar container since the TaskDefinition supports specifying multiple containers.
AWS::ECS::TaskDefinition
You can have multiple definitions where you can specify multiple images (1 for app and 1 for xray daemon sidecar)
However for Batch, we can only specify a single container in the JobDefinition which eliminates the sidecar option. Note also that even if we can define a sidecar, there are no properties to define the port mapping for the xray daemon.
AWS::Batch::JobDefinition
You can only define one ContainerProperties, hence you can only specify 1 Image.
We also don't have attributes to define port mappings unlike the TaskDefinition to enable UDP 2000.
It would be good to have support for xray to collect performance metrics for the various sub routines within the main tasks by sending subsegment traces.
Are you currently working around this issue?
Currently, I am using Cloudwatch to gather metrics instead. However Xray will have better integration in case I have upstream and downstream services e.g. I call lambda functions from my workload.
Additional context
Most of the available information regarding Fargate and Xray are pointing to using the sidecar pattern so I was unable to find a solution for AWS Batch. Kindly let me know in case I have missed a good resource or article.
Attachments
None. Let me know in case one is needed.
Community Note
Tell us about your request Running workloads using AWS Batch with Fargate compute does not support Xray. Please add support for Xray / tracing in Batch Fargate. Ideally we want an Active Tracing configuration support similar to Lambda where you can just enable without a lot of configuration.
Which service(s) is this request for? Batch with Fargate Compute Environment
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I am currently trying to enable and send Xray traces for a Batch workload running on Fargate compute but to no avail. For ECS Fargate, we currently have the option to run the Xray daemon as a sidecar container since the TaskDefinition supports specifying multiple containers.
However for Batch, we can only specify a single container in the JobDefinition which eliminates the sidecar option. Note also that even if we can define a sidecar, there are no properties to define the port mapping for the xray daemon.
It would be good to have support for xray to collect performance metrics for the various sub routines within the main tasks by sending subsegment traces.
Are you currently working around this issue? Currently, I am using Cloudwatch to gather metrics instead. However Xray will have better integration in case I have upstream and downstream services e.g. I call lambda functions from my workload.
Additional context Most of the available information regarding Fargate and Xray are pointing to using the sidecar pattern so I was unable to find a solution for AWS Batch. Kindly let me know in case I have missed a good resource or article.
Attachments None. Let me know in case one is needed.