Bugsnag middleware that increments a Datadog flavoured Statsd counter for each exception.
First, this line to your application's Gemfile
gem 'bugsnag-statsd'
Then, execute
$ bundle
Finally, add the middleware when you configure Bugsnag.
Bugsnag.configure do |config|
config.middleware.use Bugsnag::Statsd::Builder.new(tag: 'My App')
end
Without any configuration the Statsd client will connect to the default Statsd host and port.
Bugsnag.configure do |config|
config.middleware.use Bugsnag::Statsd::Builder.new(tag: 'My App')
end
The STATSD_URL
environment variable will be used if it is present.
# Boot app with environment variable present.
# Eg: `ENV["STATSD_URL"] = "localhost:9000"`
Bugsnag.configure do |config|
config.middleware.use Bugsnag::Statsd::Builder.new(tag: 'My App')
end
Last, a Statsd client can be passed to the builder.
Bugsnag.configure do |config|
config.middleware.use Bugsnag::Statsd::Builder.new(statsd: $my_statsd_client, tag: 'My App')
end
- Fork it (https://github.com/tatey/bugsnag-statsd/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request