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 improvements: pass parent context + create activity even if parent context is not defined. #403

Closed
rypdal opened this issue Jun 7, 2022 · 2 comments
Labels
comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda

Comments

@rypdal
Copy link
Contributor

rypdal commented Jun 7, 2022

Problem:

AWS lambda wrapper doesn't have possibility to pass the parent context to be used in the StartActivity call. Moreover, in the current implementation a parent context is extracted using X-Ray propagation (extracted from the _X_AMZN_TRACE_ID environment variable) and if a parent context is not extracted then no activity is created, i.e. simply saying: no parent => no activity. This behaviour is not covering all scenarios, especially the _X_AMZN_TRACE_ID doesn't always contain the correct parent and hence the parent has to be passed explicitly.

Solution:

  1. Extend public Trace methods of the AWSLambdaWrapper class with additional optional parameters: parent context and tags list.
  2. Change behaviour of the OnFunctionStart method: create Activity even if the parent context isn't defined.
@rypdal rypdal added the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Jun 7, 2022
@rypdal rypdal changed the title AWS Lambda wrapper improvements: pass parent context + create activity even if a parent context is not defined. AWS Lambda wrapper improvements: pass parent context + create activity even if parent context is not defined. Jun 7, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jun 7, 2022
- 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 added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jun 8, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jun 8, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jun 9, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jun 20, 2022
…e function trigger and lambda context

2. added parent context extraction for http triggered AWS Lambdas
3. aligned unit tests accordingly
(open-telemetry#403)
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jun 21, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jun 29, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 11, 2022
…ls.GetFunctionDefaultTags and used them for Activity creation

- refactored AWSLambdaWrapper.Trace methods: removed duplicate code
- extended Trace methods xml-doc
(open-telemetry#403)
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 11, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 20, 2022
- made ILambdaContext argument mandatory
- removed Trace methods without ILambdaContext
- added Trace overloads without input argument (input only with ILambdaContext)
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 20, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 25, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 28, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 28, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 29, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 29, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 29, 2022
…tion/AWSLambdaWrapper.cs


review (open-telemetry#403)

Co-authored-by: Christian Neumüller <[email protected]>
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 29, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Jul 29, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Aug 5, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Aug 5, 2022
rypdal added a commit to rypdal/opentelemetry-dotnet-contrib that referenced this issue Aug 5, 2022
@Oberon00
Copy link
Member

@rypdal Is there still something left to do or can this be closed?

@rypdal
Copy link
Contributor Author

rypdal commented Jul 18, 2023

@Oberon00 : it can be closed.

@rypdal rypdal closed this as completed Jul 18, 2023
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

No branches or pull requests

2 participants