Skip to content

Comments

feat(lambda): read cloud.account.id from symlink in Lambda detector#507

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

feat(lambda): read cloud.account.id from symlink in Lambda detector#507
RaphaelManke wants to merge 2 commits intoopen-telemetry:mainfrom
RaphaelManke:feat/cloud-account-id-symlink

Conversation

@RaphaelManke
Copy link

@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 is_link() + readlink() to read the symlink target
  • Silently skips if the symlink doesn't exist (null attribute skipped by Attributes builder)

Depends on

Changes

  • Detector.php — Added readlink logic with ACCOUNT_ID_SYMLINK_PATH constant
  • DetectorTest.php — Happy path and missing symlink tests

Test plan

  • Unit test: symlink exists → cloud.account.id set correctly
  • Unit test: missing symlink → attribute absent, no error

The Lambda resource detector now reads the /tmp/.otel-account-id symlink
via readlink() and sets cloud.account.id on the resource. If the symlink
is missing or unreadable, detection proceeds without the attribute.
@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant