[WIP/PoC] Add FAAS semconv opt-in and AwsLambdaInstrumentor configuration #2356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
WIP/PoC
Adds FAAS semconv opt-in to the existing implementation for HTTP opt-in. The new attributes are based on aws-lambda.md semconv. Both FAAS and HTTP semconv opt-in are set dependingon on
OTEL_SEMCONV_STABILITY_OPT_IN
which is a comma-delimited string. Currently if set as"default"
then both FAAS and HTTP use the old semconv, and any empty is default. Examples:OTEL_SEMCONV_STABILITY_OPT_IN
"default"
"http"
"faas"
"faas/dup"
"http,faas"
"http/dup,faas/dup"
"http/dup,faas"
Adds
AwsLambdaInstrumentor
usage of the FAAS opt-in. Setting of span attributes in this instrumentor depends onspan.is_recording()
after the call tostart_as_current_span
. So I made the new_set_*
methods for the FAAS opt-in do directspan.set_attribute
calls though this is not as uniform.Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I've packaged a custom version of layer-python (e.g. release 0.4.0) with these changes and set
OTEL_SEMCONV_STABILITY_OPT_IN
before invoking an equipped AWS Lambda function.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.