Skip to content
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

AWS Lambda wrapper enhancements: Trace methods enhancements and Activity creation behaviour changes. #408

Merged

Conversation

rypdal
Copy link
Contributor

@rypdal rypdal commented Jun 8, 2022

Changes

  1. Extended public Trace methods of the AWSLambdaWrapper class with additional optional parameter: parent context which is used further for ActivitySource.StartActivity(...) call.
  2. If the parent context is not provided to one of Trace methods from the AWSLambdaWrapper then parent is extracted from the incoming request if it's type is either APIGatewayProxyRequest or APIGatewayHttpApiV2ProxyRequest (both from Amazon.Lambda.APIGatewayEvents namespace). Corresponding method ExtractParentContext has been added to the AWSLambdaUtils class.
  3. Changed behaviour of the OnFunctionStart method: Activity is created even if the parent context isn't defined.
  4. Breaking change: AWSLambdaWrapper.Trace overloads without ILambdaContext argument have been completely removed. All current AWS lambda triggers provide ILambdaContext hence it's always possible to pass it from customer's code. The ILambdaContext is used further for function default tags definition.
  5. Two additional AWSLambdaWrapper.Trace overloads without generic input arguments have been added for the case of functions with only ILambdaContext as input.

rypdal added 3 commits June 7, 2022 18:03
- added optional parent context and tags parameters to tracing methods of AWSLambdaWrapper
- changed parent related behaviour of OnFunctionStart method
- added option flag for ignoring X-Ray propagation
@rypdal rypdal requested a review from a team June 8, 2022 15:32
@rypdal rypdal changed the title AWS Lambda wrapper enhancements (issue #403) AWS Lambda wrapper enhancements: Trace methods enhancements and Activity creation behaviour changes. Jun 8, 2022
@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #408 (cc51acf) into main (2c57ff0) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #408   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        167     168    +1     
  Lines       5100    5125   +25     
=====================================
- Misses      5100    5125   +25     
Impacted Files Coverage Δ
...ation.AWSLambda/AWSLambdaInstrumentationOptions.cs 0.00% <0.00%> (ø)
...ntation.AWSLambda/Implementation/AWSLambdaUtils.cs 0.00% <0.00%> (ø)
...ation.AWSLambda/Implementation/AWSLambdaWrapper.cs 0.00% <0.00%> (ø)
...ation.AWSLambda/TracerProviderBuilderExtensions.cs 0.00% <0.00%> (ø)

@utpilla utpilla added the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Jun 8, 2022
@utpilla
Copy link
Contributor

utpilla commented Jul 14, 2022

@srprash Could you please review this PR?

Copy link
Member

@Oberon00 Oberon00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing all my comments!

@Oberon00
Copy link
Member

Oberon00 commented Aug 4, 2022

Hello! From my and @rypdal's perspective, this PR would be ready for merging.

@utpilla
Copy link
Contributor

utpilla commented Aug 4, 2022

Please add a CHANGELOG entry and we can merge this.

@rypdal
Copy link
Contributor Author

rypdal commented Aug 5, 2022

Please add a CHANGELOG entry and we can merge this.

@utpilla: CHANGELOG entry has been added.

@utpilla utpilla merged commit ba73fd8 into open-telemetry:main Aug 5, 2022
@utpilla
Copy link
Contributor

utpilla commented Aug 5, 2022

@rypdal Please follow the steps mentioned here if you want to request a package release: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/CONTRIBUTING.md#how-to-request-for-release-of-package

@rypdal
Copy link
Contributor Author

rypdal commented Aug 8, 2022

Thanks to @Oberon00 for the review !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants