-
Notifications
You must be signed in to change notification settings - Fork 421
Add support in Tracer for additional arguments in the lambda_handler #242
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
Comments
Hi @hanninen, thanks for raising this - We're returning from PTO this week. Do you mean like this? ...
@tracer.capture_lambda_handler
def handler(event, context, **kwargs):
return dummy_response If so, sure thing, it'd be a no brainier for us to ship it in the next release - let us know! Here's a test to exemplifies this better: def test_capture_lambda_handler_with_additional_kwargs(dummy_response):
# GIVEN tracer lambda handler decorator is used
tracer = Tracer(disabled=True)
# WHEN a lambda handler signature has additional keyword arguments
@tracer.capture_lambda_handler
def handler(event, context, my_extra_option=None, **kwargs):
return dummy_response
# THEN tracer should not raise an Exception
handler({}, {}, blah="blah") Thank you |
Yes |
Thanks @hanninen - It'll be available tomorrow in the 1.10 release |
hey @hanninen - This is now available on 1.10 on PyPi and on SAR :) Closing this now, and thank you for raising it |
Is your feature request related to a problem? Please describe.
We have a decorator that injects a new argument to the lambda_handler and this is not compatible with the current implementation of the
Tracer.capture_lambda_handler
, as it calls the passedlambda_handler
with the standarevent
andcontext
arguments only.Describe the solution you'd like
Allow other decorators to add new arguments to the
lambda_handler
and pass**kwargs
in addition to theevent
andcontext
variables to thelambda_handler
call.Describe alternatives you've considered
Can the
Tracer.capture_lambda_handler
be changed not to call thelambda_handler
, but pass down the decorated function with thetracer
instance?The text was updated successfully, but these errors were encountered: