[detectors-aws] incomplete containerId detected for AWS ECS Fargate #2455
Labels
bug
Something isn't working
good first issue
pkg:resource-detector-aws
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
up-for-grabs
Good for taking. Extra help will be provided by maintainers
What version of OpenTelemetry are you using?
What version of Node are you using?
What did you do?
I initialize my tracing similar to the setup below as one of the first actions within my Node.js express server. I bundle the whole application via Docker and deploy it to AWS ECS on Fargate.
What did you expect to see?
I would expect to see something like
<taskId>-<containerId>
as thecontainer.id
in my span attributes. This would fit the conventions that observability vendors like Datadog use. For a task namedc23e5f76c09d438aa1824ca4058bdcab
I'd expect to see something likec23e5f76c09d438aa1824ca4058bdcab-1234678
for a single container.What did you see instead?
As part of aws/amazon-ecs-agent#1119 AWS apparently shifted their cgroup naming convention to something like
/ecs/<taskId>/<taskId>-<containerId>
. Given the 64 character limit it usually cuts off in the middle of taskId. For the example above, this would yield acontainer.id
value like438aa1824ca4058bdcab/c23e5f76c09d438aa1824ca4058bdcab-1234678
.Is there some way to consistently receive only the part after the
/
in the cgroup name, i.e. the last chunk? Happy to contribute in case this seems desirable. It should probably follow a regex based approach like in DataDog/dd-trace-js#1176.The text was updated successfully, but these errors were encountered: