I would like to send Raven messages to multiple DSNs based on the controller name / or some config.
But the integration assumes only one raven client.
Can I get a better way to integrate so that I can configure different raven-clients based on controllers.
You can do this, we just have to document it.
You can have an unlimited amount of Raven::Instance objects, each which can have their own configuration (and thus DSN).
OK, I just realized you actually can't do this, because the Rack middleware uses the global instance.
If you could provide a Raven instance to the Rack middleware, you could:
This is a big feature, so deferring to 3.0.
@nateberkopec Is this feature available? :+1:
Welp - time for the yearly bump. I'm also interested in this feature.
hello 馃憢, I'm the current maintainer of this gem and because v3 has been released and this will be a structural change, we need to push this to the next major release (v4). will keep you posted here 馃槈
@sheki thanks for the long-waiting, but I have some good news here 馃槃
if you migrate to the new sentry-ruby SDK, the Scope & Hub structure will allow you to do that.
this is just a short example on how to initialize multiple hubs with different config objects:
dsn_1 = "DSN_1"
dsn_2 = "DSN_2"
config_1 = Sentry::Configuration.new.tap { |config| config.dsn = dsn_1 }
config_2 = Sentry::Configuration.new.tap { |config| config.dsn = dsn_2 }
hub_1 = Sentry::Hub.new(Sentry::Client.new(config_1), Sentry::Scope.new)
hub_2 = Sentry::Hub.new(Sentry::Client.new(config_2), Sentry::Scope.new)
hub_1.capture_message("message to DSN 1") #=> will be sent to DSN_1
hub_2.capture_message("message to DSN 2") #=> will be sent to DSN_2
I'm closing this now, but feel free to reopen it if you still have questions 馃檪
Most helpful comment
hello 馃憢, I'm the current maintainer of this gem and because v3 has been released and this will be a structural change, we need to push this to the next major release (v4). will keep you posted here 馃槈