0.0
A long-lived project that still receives updates
Utilities to be used with PeakFlow.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

PeakflowUtils

Various tools to use with www.peakflow.io.

Installation

Add this line to your application's Gemfile:

gem "peak_flow_utils"

And then execute:

$ bundle

Or install it yourself as:

$ gem install peak_flow_utils

Add this to config/peakflow.rb:

PeakFlowUtils::Notifier.configure(auth_token: "your-token")

Usage

Reporting errors manually

PeakFlowUtils::Notifier.notify(error: error)

Reporting Rails errors

Add this to config/peakflow.rb:

PeakFlowUtils::NotifierRails.configure

Reporting ActiveJob errors in Rails:

If you want the job name and its arguments logged in parameters you can execute this service:

PeakFlowUtils::ActiveJobParametersLogging.execute!

Reporting Sidekiq errors in Rails:

Add this to config/peakflow.rb:

PeakFlowUtils::NotifierSidekiq.configure

If you want the job name and its arguments logged in parameters you can execute this service:

PeakFlowUtils::SidekiqParametersLogging.execute!

Sidekiq and Postgres pings

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

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.