diff --git a/specification/trace/semantic_conventions/instrumentation/aws-lambda.md b/specification/trace/semantic_conventions/instrumentation/aws-lambda.md index 9814df780..e61ec2822 100644 --- a/specification/trace/semantic_conventions/instrumentation/aws-lambda.md +++ b/specification/trace/semantic_conventions/instrumentation/aws-lambda.md @@ -218,3 +218,17 @@ have a parent of `Span Lambda`. This means the hierarchy looks like: Span Lambda --> Span ProcBatch --> Span Proc1 (links to Span Prod1 and Span Prod2) \-> Span Proc2 (links to Span Prod1 and Span Prod2) ``` + +## Resource Detector + +AWS Lambda resource information is available as [environment variables][] provided by the runtime. + +- [`cloud.provider`](../../../resource/semantic_conventions/cloud.md) MUST be set to `aws` +- [`cloud.region`](../../../resource/semantic_conventions/cloud.md) MUST be set to the value of the `AWS_REGION` environment variable +- [`faas.name`](../../../resource/semantic_conventions/faas.md) MUST be set to the value of the `AWS_LAMBDA_FUNCTION_NAME` environment variable +- [`faas.version`](../../../resource/semantic_conventions/faas.md) MUST be set to the value of the `AWS_LAMBDA_FUNCTION_VERSION` environment variable + +Note that [`faas.id`](../../../resource/semantic_conventions/faas.md) currently cannot be populated to resource +because it is not available until function invocation. + +[environment variables]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime