-
Notifications
You must be signed in to change notification settings - Fork 621
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
lambda instrumentation - support for flush timeout #825
Conversation
...elemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we should allow configuring timeout at the provided level instead of a specific instrumentation? @open-telemetry/python-approvers thoughts?
I believe that in this particular case it makes sense - force flush upon function completion is specific to AWS lambda and aligns Python with Java (and others in the future) - hence prop name |
It is not really harmful but I think we'll have to add support for something like |
Hard to say :) Other distros (say - Java) didn't implement generic timeout for forceFlush. On the other side in Java it's implemented as an async call and the caller can decide to wait (or not) for completion of the call. If you see potential uses besides lambda for configurable timeout then it definitely makes sense to move this to SpanProcessor. Let me know (in the meantime I've added try/catch for int conversion ;) ). |
This has come up a couple of times on related issues so I think it could be useful. Personally I'm fine with merging this as is in order to not block a useful feature. @open-telemetry/python-approvers any preferences? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the try..catch block around env var
I thought there was already some env to support this. I also agree that we should have something like |
Yeah, forgot to update the commit 🤦 Now it's where supposed to be. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think it would be beneficial to have the environment variable at the SDK layer, but I can also see the Java SDK has this similar variable.
Either way this looks useful, thanks for the change!
...ion/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py
Outdated
Show resolved
Hide resolved
...ion/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py
Outdated
Show resolved
Hide resolved
…/test_aws_lambda_instrumentation_manual.py Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
…/test_aws_lambda_instrumentation_manual.py Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
@open-telemetry/python-maintainers can we get this merged please? :) |
...elemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py
Show resolved
Hide resolved
Head branch was pushed to by a user without write access
* lambda instrumentation - support for flush timeout * Update instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca> * Update instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca> * fixing lint * fixing django lint Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
* lambda instrumentation - support for flush timeout * Update instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca> * Update instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca> * fixing lint * fixing django lint Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
Description
Adds support for configurable flush timeout to AWS lambda instrumentation. Property name aligned with other implementations (Java).
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.