Skip to content

blasterpal/readouts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple Sinatra, mountable, plugable metric and dashboard framework for getting information you care about for your web app. This project was inspiried by my work and that of others on this project: github.com/primedia/ops.

The config.ru is a great example of how’d you’d use metrics. You can define really complex metrics to gather and inject into tabs. Everything from your Sidekiq queues to whatever you can think of. To configure Readouts, you call methods or setters for specific options using a block style.

Readouts::MetricsInfo.configure do |c|
  # configure the basics about your app
  c.app_name = 'My Great App'
  c.github_base_url = 'https://github.com/blasterpal/readouts'
  c.file_root = Dir[__FILE__] #to set relativy for finding REVISION file
  # enable features 
  c.headers_enabled = true
  c.version_info_enabled = true
  #register metrics 
  c.register_metric 'env' , ENV, '*Nix environment'
  c.register_metric 'my_metric', {:foo => 'bar'}
end

The revision displayed on the footer will look for a REVISION file which is common for Capistrano deployments.

You should use a Rails constraint when mounting the app or implement your own auth around the mount point. There is NO security built into to this GEM as it exposes nothing by default other than a blank page and a little info.

# your wonderful routes file
constraint = lambda { |request| request.env["warden"].authenticate? and request.env['warden'].user.is_admin? }
constraints contraint do
  mount Readouts::Web => '/readouts'
end

rake test

  • bundle exec rackup -p 3001

  • bundle exec irb -r ./lib/readouts

  • bundle exec pry -r ./lib/readouts

Not tested on Windows

Copright © 2013 Hank Beaver and Obie Fernandez

About

A simple Sinatra, mountable, plugable metric and dashboard framework for getting information you care about for your web app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors