Skip to content

[WIP/PoC] Add FAAS semconv opt-in and AwsLambdaInstrumentor configuration #2356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

tammy-baylis-swi
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi commented Mar 19, 2024

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 http faas
empty old old
"default" old old
"http" new old
"faas" old new
"faas/dup" old both
"http,faas" new new
"http/dup,faas/dup" both both
"http/dup,faas" both new

Adds AwsLambdaInstrumentor usage of the FAAS opt-in. Setting of span attributes in this instrumentor depends on span.is_recording() after the call to start_as_current_span. So I made the new _set_* methods for the FAAS opt-in do direct span.set_attribute calls though this is not as uniform.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@tammy-baylis-swi tammy-baylis-swi changed the title [WIP] Add FAAS semconv opt-in and AwsLambdaInstrumentor configuration [WIP/PoC] Add FAAS semconv opt-in and AwsLambdaInstrumentor configuration Mar 19, 2024
@tammy-baylis-swi tammy-baylis-swi force-pushed the lambda-instrumentor-opt-in branch from 878f539 to b558905 Compare March 20, 2024 00:26
@tammy-baylis-swi tammy-baylis-swi force-pushed the lambda-instrumentor-opt-in branch from b558905 to 31c65ca Compare March 20, 2024 00:39
@tammy-baylis-swi
Copy link
Contributor Author

Closing this in favour of #2371.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant