elastic / elastic/apm

Update AWS ECS Fargate container ID regex.

Open
#888 0 comments 0 reactions 0 assignees View on GitHub
apm-agents meta
Dominant language
Gherkin
Stars
427
Forks
125
PR merge metrics
No merged PRs in 30d

Description

# Description

As per https://github.com/elastic/apm/pull/886

> We have new evidence that ID part of ECS Fargate container may end in 1 to 10 digits not exactly 10 digits.

And As per https://github.com/elastic/apm/issues/887

> Through a customer support case, we've been notified of a failure to parse the container ID from `/proc/self/cgroup` for a service running on ECS Fargate. In this customer's case, the container ID does not seem to conform to the expected format of the Docker ID in AWS ECS Fargate, which, [per this documentation](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4-response.html), is expected to be 32 hex characters followed by a dash and then ten numeric digits.

> In this customer case, in two out of 30 services, there are only nine numeric digits after the dash. It is unclear if this is a bug in AWS, but as it is not documented, it could well be. AWS support has been unable to reproduce this on their end. Since [our specification](https://github.com/elastic/apm/blob/main/specs/agents/metadata.md#containerkubernetes-metadata) uses a strict regex to match the possibility of an ECS Fargate format, for this customer, our APM agents will be unable to parse the container ID while using our regex.

We in fact observed a new case since ending in 8 digits.

This issue is created to track everyone updating their regex for ECS Fargate container IDs to:

```regexp
^[[:xdigit:]]{32}-[[:digit:]]{1,10}$
```

To be up to date with the specification change from: https://github.com/elastic/apm/pull/886

# Issues creation

## Create Spec issue?
- [x] Spec issue

## Create APM Agent issues?
- [ ] elastic-otel-java
- [ ] elastic-otel-dotnet
- [ ] elastic-otel-node
- [ ] elastic-otel-python
- [ ] elastic-otel-php
- [x] apm-agent-java
- [x] apm-agent-dotnet
- [x] apm-agent-nodejs
- [x] apm-agent-python
- [x] apm-agent-go
- [x] apm-agent-php
- [x] apm-agent-ruby

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.