-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add additional hooks on django middleware #139
Add additional hooks on django middleware #139
Conversation
Ah, I see what you might want to do here. I'm going to discuss this with another engineer. Could be useful! |
Hey there, just wanted to say that we haven't forgotten about you. We want to support this feature and we're trying to decide the best way to go about it. |
hahaha ok @ezarowny, no rush! =] |
Hey @filwaitman, sorry for the delay there. The middleware solution you presented is definitely a valid way to go about this but I've been trying to think of a way that would feel more official. As far as I know, you can't pass any arguments to the As Django's settings files are just Python files, what do you think about storing or importing the I'm not sure if this is actually any simpler yet. Just an idea I've been mulling over. |
Hi! Sounds a good idea. |
Oh that's alright. I'll get a PR together with how I think this should work and I'll tag you so we can discuss it. |
Ok, sounds perfect! |
@ezarowny what's next for this PR? |
Just need to write up the handlers for Django and test it out. |
I'm interested in this as well, any progress or plan to support this? I'm looking for a way to specify which user had the problem with some stacktrace and this seems like a potential solution. |
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 tested this pull request on top of latest master
branch and I confirm it works as expected. I see custom keys in params
on the rollbar dashboard 👍
Any plan to merge this?
Example I used:
from rollbar.contrib.django.middleware import RollbarNotifierMiddleware
class CustomRollbarNotifierMiddleware(RollbarNotifierMiddleware):
@staticmethod
def get_extra_data(request, exc):
try:
# returning user here is kind of pointless as it's already included in `person`
# but still, this is a valid example
return dict({'user': request.user})
except Exception:
# if things go wrong, don't make it worst and let the rollbar notification leave
return None
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.
This looks good as is to me
Child of #137 (see this for the entire thread)