From 6c1ab84bb2c882d4715ab7b3276c5bb043d71867 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Fri, 16 Apr 2021 02:00:34 +0900 Subject: [PATCH] Add details for filling resource for AWS Lambda. (#1610) --- .../instrumentation/aws-lambda.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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