Skip to content

feat(resource-detector-aws): read cloud.account.id from symlink in Lambda detector#3377

Open
RaphaelManke wants to merge 4 commits intoopen-telemetry:mainfrom
RaphaelManke:feat/cloud-account-id-symlink
Open

feat(resource-detector-aws): read cloud.account.id from symlink in Lambda detector#3377
RaphaelManke wants to merge 4 commits intoopen-telemetry:mainfrom
RaphaelManke:feat/cloud-account-id-symlink

Conversation

@RaphaelManke
Copy link
Contributor

@RaphaelManke RaphaelManke commented Feb 9, 2026

Summary

  • Reads cloud.account.id from the symlink at /tmp/.otel-aws-account-id created by the OTel Lambda Extension
  • Uses fs.readlinkSync() to read the symlink target (the AWS account ID)
  • Logs at debug level if the symlink doesn't exist — no impact on other resource detection

Depends on

Changes

  • AwsLambdaDetector.ts — Added readlink logic with ACCOUNT_ID_SYMLINK_PATH constant
  • Tests: happy path, leading zeros preserved, missing symlink handled gracefully

Test plan

  • Unit test: symlink exists → cloud.account.id set correctly
  • Unit test: leading zeros preserved as string
  • Unit test: missing symlink → attribute absent, no error

…mbda detector

Read /tmp/.otel-account-id via readlinkSync to populate the
cloud.account.id resource attribute. The symlink is created by the
OTel Lambda extension with the AWS account ID as its target.
On failure (missing symlink or readlink error), detection silently
continues without setting the attribute.
@github-actions github-actions bot requested a review from jj22ee February 9, 2026 20:14
@RaphaelManke RaphaelManke changed the title feat(lambda): read cloud.account.id from symlink in Lambda detector feat(resource-detector-aws): read cloud.account.id from symlink in Lambda detector Feb 9, 2026
@RaphaelManke RaphaelManke marked this pull request as ready for review February 19, 2026 08:03
@RaphaelManke RaphaelManke requested a review from a team as a code owner February 19, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants