-
Notifications
You must be signed in to change notification settings - Fork 402
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
Reusing Tracer across your code disables patching boto3 #108
Labels
documentation
Improvements or additions to documentation
Comments
michaelbrewer
added
bug
Something isn't working
triage
Pending triage from maintainers
labels
Aug 15, 2020
That’s exactly it Michael - Could you try removing auto_patch from your
shared?
Under the hood, a module is only patched once by X-Ray SDK as it uses the
importlib package.
I’ll leave this open to add a clarification note in the docs about this
…On Sat, 15 Aug 2020 at 05:02, Michael Brewer ***@***.***> wrote:
*What were you trying to accomplish?*
I am have my shared code include @tracer but i don't want to double patch
boto3 etc..
Expected Behavior
tracer = Tracer(auto_patch=False) should not disable patching in the main
lambda handler
Current Behavior
When i go into the console now of the boto3 activity appears
# main.pyfrom aws_lambda_powertools import Tracerfrom app import shared
tracer = Tracer(service="payment")
@tracer.capture_lambda_handlerdef handler(event, context):
pass
# shared.pyfrom aws_lambda_powertools import Tracer
tracer = Tracer(auto_patch=False)
Possible Solution
I think because the shared.py - tracer = Tracer(auto_patch=False) code is
called before the main.py. The patching has already been disabled.
Environment
- *Powertools version used*: 1.1.1
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#108>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBGD7VEEB7EREACBVJLSAX3CZANCNFSM4QABHJ4A>
.
|
Ok. Then I must have misunderstood the docs. I thought if you don't want to double patch you turn it off in the shared code but it will patch in the main handler file. Currently I don't include it and it works. I guess it is a matter looking closely at the docs. |
Nope, it’s on us - I had a second look at the docs and the wording isn’t
right; I‘ll fix it
…On Sat, 15 Aug 2020 at 06:54, Michael Brewer ***@***.***> wrote:
Ok. Then I must have misunderstood the docs. I thought if you don't want
to double patch you turn it off in the shared code but it will patch in the
main handler file.
Currently I don't include it and it works. I guess it is a matter looking
closely at the docs.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBHCQW32UW4MCPZA47LSAYIH7ANCNFSM4QABHJ4A>
.
|
heitorlessa
referenced
this issue
in heitorlessa/aws-lambda-powertools-python
Aug 15, 2020
6 tasks
heitorlessa
referenced
this issue
in heitorlessa/aws-lambda-powertools-python
Aug 15, 2020
@michaelbrewer When you can, could you please review the docs statement to make sure it's clearer? PR #109 |
heitorlessa
added a commit
that referenced
this issue
Aug 16, 2020
docs: clarify Tracer auto_patch as per #108
heitorlessa
added
documentation
Improvements or additions to documentation
area/tracer
and removed
bug
Something isn't working
triage
Pending triage from maintainers
labels
Aug 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What were you trying to accomplish?
I am have my shared code include
@tracer
but i don't want to double patch boto3 etc..Expected Behavior
tracer = Tracer(auto_patch=False)
should not disable patching in the main lambda handlerCurrent Behavior
When i go into the console now of the boto3 activity appears
Possible Solution
I think because the shared.py -
tracer = Tracer(auto_patch=False)
code is called before the main.py. The patching has already been disabled.Environment
The text was updated successfully, but these errors were encountered: