Giter VIP home page Giter VIP logo

notable's Introduction

Notable

🌟 Extraordinary insight into your users and background jobs

Wouldn’t it be great to see when one of your users encounters an error, timeout, or validation failure? Now you can - directly in your admin pages.

Introducing Notable

Notable tracks notable requests and background jobs and stores them in your database. What makes a request or job notable? There are a number of default situations, but ultimately you decide what interests you.

By default, Notable tracks:

  • errors
  • 404s
  • slow requests and jobs
  • timeouts
  • validation failures
  • CSRF failures
  • unpermitted parameters
  • blocked and throttled requests

You can track custom notes as well.

🍊 Battle-tested at Instacart

Installation

Add this line to your application’s Gemfile:

gem 'notable'

And run:

rails generate notable:requests
rails generate notable:jobs
rake db:migrate

For a web interface, check out Notable Web.

Requests

A Notable::Request is created for:

  • errors
  • 404s
  • slow requests
  • timeouts
  • validation failures
  • CSRF failures
  • unpermitted parameters
  • blocked and throttled requests

For timeouts, use Slowpoke.

For blocked and throttled requests, use Rack Attack.

Jobs

Wouldn’t it be great to have a record of exact jobs that fail?

A Notable::Job is created for:

  • errors
  • slow jobs
  • validation failures

Manual Tracking

Notable.track(note_type, note)

Like

Notable.track("Auth Event", "Signed In")

Customize

Disable tracking in certain environments

Notable.enabled = Rails.env.production?

Requests

Set slow threshold

Notable.slow_request_threshold = 5 # seconds (default)

Custom user method

Notable.user_method = -> (env) {
  env["warden"].try(:user) || env["action_controller.instance"].try(:current_visit)
}

Custom track method

Notable.track_request_method = -> (data, env) {
  Notable::Request.create!(data)
}

Skip tracking CSRF failures

skip_before_action :track_unverified_request

Anonymize IP addresses

Notable.mask_ips = true

Jobs

Set slow threshold

Notable.slow_job_threshold = 60 # seconds (default)

Custom track method

Notable.track_job_method = -> (data) {
  Notable::Job.create!(data)
}

TODO

  • ability to disable features
  • add indexes

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

notable's People

Contributors

ankane avatar daniel-sullivan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.