open-telemetry / opentelemetry-lambda

Create your own Lambda Layer in each OTel language using this starter code. Add the Lambda Layer to your Lamdba Function to get tracing with OpenTelemetry.
https://opentelemetry.io
Apache License 2.0
276 stars 167 forks source link

Include memory assigned to the lambda function as part of the trace #251

Closed juanitosvq closed 1 month ago

juanitosvq commented 2 years ago

Hi, I noticed that the spec has an attribute faas.max_memory that describes the memory assigned to the lambda function: https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/faas/

I wasn't able to find that attribute in our traces when using the otel layer. I believe it would just be a matter of updating this: https://github.com/open-telemetry/opentelemetry-lambda/blob/main/python/src/otel/otel_sdk/otel-instrument#L130 to include AWS_LAMBDA_FUNCTION_MEMORY_SIZE, since this should already be available on runtime: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime

I'll be happy to open a PR if this makes sense.

Thanks!

github-actions[bot] commented 3 months ago

This issue was marked stale. It will be closed in 30 days without additional activity.

github-actions[bot] commented 1 month ago

Closed as inactive. Feel free to reopen if this issue is still relevant.