Skip to content

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

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

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

Conversation

@RaphaelManke
Copy link

Summary

  • Reads cloud.account.id from the symlink at /tmp/.otel-account-id created by the OTel Lambda Extension
  • Uses Files.readSymbolicLink() to read the symlink target
  • Silently skips via catch (IOException | UnsupportedOperationException) if the symlink doesn't exist

Depends on

Changes

  • LambdaResource.java — Added readlink logic with ACCOUNT_ID_SYMLINK_PATH constant, injectable Path for testing
  • LambdaResourceTest.java — Happy path, missing symlink, leading zeros tests

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

…ector

Read /tmp/.otel-account-id via Files.readSymbolicLink in LambdaResource
and set cloud.account.id resource attribute. Silently skips if the
symlink does not exist or readlink is unsupported. Preserves leading
zeros by treating the value as a string.
@github-actions github-actions bot requested review from srprash and wangzlei February 9, 2026 20:14
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