honeybadger-io / honeybadger-python

Send Python and Django errors to Honeybadger.
https://www.honeybadger.io/
MIT License
15 stars 25 forks source link

Add local variables to notifications #123

Closed remstone7 closed 1 year ago

remstone7 commented 1 year ago

122

Adds local_variables to request

remstone7 commented 1 year ago

@joshuap yup it has it in the inspect package here: https://docs.python.org/3/library/inspect.html - this is a built in so no performance impacts, this is similar to what sentry does, the only difference than how i implemented it is that they take the entire traceback, create a frame for each and then get the local variables for each frame (section of the traceback). other implementations like inspect.currentframe().f_locals

Makes sense about the sensitive keys and good call out here, will utilize param filters for that and then will also make it a configurable option 👍 thanks for the feedback!

subzero10 commented 1 year ago

LGTM. Thank you @remstone7! I'll wait for the param filtering + config option before approving.

remstone7 commented 1 year ago

latest push: using django to test a view but config: image

inside the app: image

joshuap commented 1 year ago

Looking good here, well let @subzero10 review.

Since it's possible to get local variables for every frame of the stack trace, should we plan to modify our notice schema to add a local_variables option to the stack frame? We could then implement an expanded local_variables feature in a subsequent version of honeybadger-python.

remstone7 commented 1 year ago

This would be 🎉

Since it's possible to get local variables for every frame of the stack trace, should we plan to modify our notice schema to add a local_variables option to the stack frame? We could then implement an expanded local_variables feature in a subsequent version of honeybadger-python.