Skip to content

fix(otel): report faas.max_memory in bytes - #1074

Merged
zhongkechen merged 4 commits into
aws:mainfrom
Thanatos9404:fix/otel-max-memory-bytes
Oct 24, 2026
Merged

zhongkechen merged 4 commits into
aws:mainfrom
Thanatos9404:fix/otel-max-memory-bytes

Conversation

@Thanatos9404

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

Fixes #1053

Description

The Execution view set faas.max_memory on the Invocation span straight from AWS_LAMBDA_FUNCTION_MEMORY_SIZE, which Lambda gives in MiB. The semantic conventions define the attribute in bytes, so a 1024 MiB function reported 1024. It now multiplies by 1024 * 1024, as the AWS Lambda resource detector does, and the same inputs still produce or skip the attribute. The README and CHANGELOG note the unit.

Demo/Screenshots

N/A

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Yes. 128, 1024 and 10240 MiB fail on main and pass here. An unset or invalid value, and the global provider, still get no attribute.

Integration Tests

No, the unit tests cover it.

Examples

Not applicable.

ExecutionOtelPlugin set faas.max_memory on the Invocation span from
AWS_LAMBDA_FUNCTION_MEMORY_SIZE as is, which Lambda gives in MiB. The
semantic conventions define the attribute in bytes, so 1024 MiB was
reported as 1024 instead of 1073741824. Multiply by 1024 * 1024, as the
OpenTelemetry AWS Lambda resource detector does.

Fixes aws#1053
@Thanatos9404
Thanatos9404 temporarily deployed to ai-pr-review-runtime October 23, 2026 21:22 — with GitHub Actions Inactive
@zhongkechen
zhongkechen merged commit e049d07 into aws:main Oct 24, 2026
16 checks passed
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.

[Bug]: Execution OTel view emits faas.max_memory in MiB instead of bytes

2 participants