-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Component(s)
processor/resourcedetection
Is your feature request related to a problem? Please describe.
Currently there is no seamless way to add AWS Lambda resource information into traces, metrics, and logs. Since there is support for running the Open Telemetry collector within the AWS Lambda runtime, ideally there would be an easy way collect the AWS Lambda host resource information via the collector.
Describe the solution you'd like
Add a new AWS Lambda Resource Detection Processor, similar to the existing aws resource detection processors.
The implementation should be similar the the lambda detector built into the opentelemetry-go-contrib
repo where we can simply use the AWS Lambda reserved environment variables to gather the necessary resource information.
Additionally, it would be nice if, like the AWS EC2 resource detection processor, the lambda resource detection processor supported gathering tags for the Lambda Function. Like the EC2 resource detection processor, this would require that users add an IAM permission to the Lambda Function IAM role in order to get the function's tags, specifically the lambda:ListTags
permission.
Describe alternatives you've considered
Since the AWS Lambda Function resource information is exposed as environment variables, technically it should be possible to use the Resource Processor to insert / upsert attributes using environment variable values, but this would mean all users would need to know and understand the correct standard open telemetry attribute names and their corresponding AWS Lambda reserved environment variable values. Also, this would not support collecting the lambda function's tags.
Another alternative that most users likely do today is to use a resource detector built into their programming language's open telemetry instrumentation library, like Go's lambda detector, Python's AwsLambdaResourceDetector, Java's LambdaResource, .NET's AWSLambdaResourceDetector, JavaScript's AwsLambdaDetector, etc.
Additional context
Assuming a new AWS Lambda Resource Detection Processor is created, likely the OpenTelemetry Lambda project and the corresponding AWS managed OpenTelemetry Lambda Layers project would need to be updated to include the Resource Detection Processor in their distributions.