-
Notifications
You must be signed in to change notification settings - Fork 135
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
how to reinitialize rollbar #337
Comments
I haven't looked into this much (and this is not my library, but I have submitted a couple PRs against this repo), however, I think that probably will not work for you since rollbar uses a lot of global variables and your last call to I would probably try to explain your use case a bit more, to see if it's something Rollbar wants to support, but it likely will require a decent amount of engineering effort to refactor the library to work that way. |
I would like to be able to do something like this as well. Actually ideally I would like to be able to create a configured instance of the rollbar client that has the token it needs to route messages appropriately. For my use case I am setting up an Apache Airflow environment that will be shared by multiple teams which will own the running of their DAGs in Airflow. The team provides the their token and the global exception handler uses that token to route the messages. I want to be able to route errors and messages using a given projects token ( we use a token per team ). This way teams can provide a token for what they are working on and can be alerted when their DAGs fail. FWIW I was able to reinitialize by resetting the |
Make sure you are reconfiguring rollbar after each reset before sending a new log item otherwise you may be using old config. My comment was assuming you were just initializing with multiple projects, but if you're doing it before each message you should most likely be safe. You may need to use a blocking handler unless all the configuration is picked up and saved locally, otherwise you might end up having a race condition because the non blocking handler uses threads IIRC. |
I'd like to reinitialize rollbar, to connect to a different rollbar project. Looks like this isn't currently supported, but I found a hacky solution. Is it bad to do this? Are there negative side-effects?
pyrollbar
0.14.5
The text was updated successfully, but these errors were encountered: