open-telemetry / open-telemetry/opentelemetry-lambda

Telemetryapi receiver not respecting OTEL_RESOURCE_ATTRIBUTES env var

Open
#2,047 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug go
Dominant language
Go
Stars
432
Forks
246
Avg merge
3d 10h
Merged PRs (30d)
47

Description

Describe the bug
Similar to #1851, it looks like the telemetryapi receiver is not picking up the additional resource attributes set in the OTEL_RESOURCE_ATTRIBUTES env variable.

Steps to reproduce

  • Create and instrument a Lambda function
  • Set the OTEL_RESOURCE_ATTRIBUTES environment variable with some key/values to put on each log statement i.e
    • OTEL_RESOURCE_ATTRIBUTES: 'deployment.environment.name=dev'
  • Enable telemetryapi receiver for logs and traces
  • Send logs to your OTEL backend of choice and check for the presence of the additional resource attributes

What did you expect to see?
I expected to see the 'deployment.environment.name' attribute in log statements

What did you see instead?
The values in OTEL_RESOURCE_ATTRIBUTES are missing from log statements

What version of collector/language SDK version did you use?

  • 0.19.0 (collector layer)
  • 0.18.0 (nodejs layer)

What language layer did you use?
javascript

Additional context
The fix looks like it might be very similar to the fix for #1851 => explicitly read the env var and add the key/values to the resource map.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the telemetryapi receiver and compare its resource handling with the fix described in issue #1851. Reproduce the Lambda setup with OTEL_RESOURCE_ATTRIBUTES set to deployment.environment.name=dev, then verify that the attribute appears on exported logs and traces.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go, javascript
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.