Various tools to use with www.peakflow.io.
Add this line to your application's Gemfile:
gem "peak_flow_utils"And then execute:
$ bundleOr install it yourself as:
$ gem install peak_flow_utilsAdd this to config/peakflow.rb:
PeakFlowUtils::Notifier.configure(auth_token: "your-token")PeakFlowUtils::Notifier.notify(error: error)Errors that escape a PeakFlowUtils::Notifier.with_parameters block keep a snapshot of the scoped parameters. Later framework handlers, such as Sidekiq error handlers, can report the same error after the block has unwound and still include the captured context.
Add this to config/peakflow.rb:
PeakFlowUtils::NotifierRails.configureIf you want the job name and its arguments logged in parameters you can execute this service:
PeakFlowUtils::ActiveJobParametersLogging.execute!Add this to config/peakflow.rb:
PeakFlowUtils::NotifierSidekiq.configureIf you want the job name and its arguments logged in parameters you can execute this service:
PeakFlowUtils::SidekiqParametersLogging.execute!Add this to routes.rb:
Rails.application.routes.draw do
mount PeakFlowUtils::Engine => "/peakflow_utils"Add these to .env variables:
PEAKFLOW_PINGS_USERNAME=username
PEAKFLOW_PINGS_PASSWORD=secret-password
You can now add a HTTP ping on this path:
/peakflow_utils/pings/sidekiq
And this for Postgres:
/pings/postgres_connections
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.