-
Notifications
You must be signed in to change notification settings - Fork 4
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
Access plug_conn assigns and params in report_event? #113
Comments
Hi @blunckr-aj, Thanks for writing. So the event you're testing out is an exception? Also, are you using Thanks. |
Are you implementing a custom rollbar client yourself or using |
Note that some FWIW, this is what we're currently doing in |
Thanks for the quick responses! I'm using plug_cowboy 2.7. I'm raising an exception in my controller action, and the assigns are set in plug just before then. I'm using the tower_rollbar package, but was trying to build my own reporter. I want to add some more fields to the item before it goes out to rollbar. I didn't see a way to do that without writing my own reporter. I thought about including that as a feature request, but didn't want to complicate the issue. My reporter calls |
Gotcha. Most probably params (things that come from the original request) could be fetched in the I don't think we would be able to get the Note that when you So yes, a different approach needed. If you're wanting to set some request context for a potential exception report you could use After we added #98 we support you configuring Sorry this is not well documented. |
Ah, ok. I think Logger.metadata will do what I need. I can set some some values at the same time I set the assigns. Then I don't have to worry about re-constructing that data from the request. Thanks! Feel free to close the issue if you want. |
Hello, I'm currently working on adding this package to my app with the rollbar client, and I have a question. plug_conn gets included in the event, which is very useful, but it's missing some information. My application reads some information about the user from the request body and puts in the 'assigns' on the conn object. In the report_event function, 'assigns' is empty, and other fields are not populated as they would be during the request:
I don't know exactly how you're accessing the conn object, but this seems to be the conn before it has passed through the various plugs that parse and assign the body, params, and query params, and in my case, set some 'assigns' values.
Is it possible that those values will be assigned in the future, or could another plug be written in my app that would somehow make them accessible to Tower? (Seems like #94 might be relevant?)
Thanks for your work on this project, it seems like a great solution.
The text was updated successfully, but these errors were encountered: