Skip to content

ADOT Collector healthcheck on ECS Container don't work when deploying using AWS CDK #1320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jm-a1lab opened this issue May 14, 2025 · 0 comments

Comments

@jm-a1lab
Copy link

Hello!

I'm trying to setup the ADOT for ECS using Fargate, following the link (https://aws-otel.github.io/docs/setup/ecs/cfn-for-ecs-fargate).

But when I create the container using CDK, while using the healthcheck from addContainer method, CDK always forces the use o CMD/CMD-SHELL in the command attribute, this way the healtcheck don't work as expected.

CDK

                healthCheck: {
                    startPeriod: Duration.seconds(5),
                    command: ['/healthcheck'],
                    interval: Duration.seconds(5),
                    retries: 2,
                    timeout: Duration.seconds(3),
                }

At the end, my task definition JSON is

          "healthCheck": {
                "command": [
                    "CMD",
                    "/healthcheck"
                ],
                "interval": 5,
                "timeout": 3,
                "retries": 2,
                "startPeriod": 5
            },

This way, the healthcheck NEVER WORKS! And can't bypass this behavior in CDK.

If I remove the CMD manually in my task definition, it works as expected (with only the "/heathcheck").

I even thought it was a CDK problem but it was clarified that it wasn't, as follows: aws/aws-cdk#34389

Will be nice if the container works with CMD/CMD-SHELL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant