All Projects → yabeda-rb → Yabeda Rails

yabeda-rb / Yabeda Rails

Licence: mit
Yabeda plugin to collect basic metrics for Rails applications

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Yabeda Rails

App perf
Open source application performance monitoring tool with emphasis on ease of setup and use. Providing similar functionality like NewRelic/AppNeta/Skylight etc.
Stars: ✭ 353 (+256.57%)
Mutual labels:  rails, monitoring, metrics
Prometheus.cl
Prometheus.io Common Lisp client
Stars: ✭ 67 (-32.32%)
Mutual labels:  monitoring, metrics
Spring Boot Actuator Demo
Spring Boot Actuator: Health Check, Metrics Gathering, Auditing, and Monitoring
Stars: ✭ 61 (-38.38%)
Mutual labels:  monitoring, metrics
Miraql
GraphQL performance monitoring & error-handling tool
Stars: ✭ 97 (-2.02%)
Mutual labels:  monitoring, metrics
Polymur
A fast carbon-relay with live routing controls + https Graphite forwarder
Stars: ✭ 97 (-2.02%)
Mutual labels:  monitoring, metrics
Statsviz
🚀 Instant live visualization of your Go application runtime statistics (GC, MemStats, etc.) in the browser
Stars: ✭ 1,015 (+925.25%)
Mutual labels:  monitoring, metrics
Legacy Kubernetes App
Grafana App for Kubernetes
Stars: ✭ 76 (-23.23%)
Mutual labels:  monitoring, metrics
Pgwatch2
PostgreSQL metrics monitor/dashboard
Stars: ✭ 960 (+869.7%)
Mutual labels:  monitoring, metrics
Beamium
Prometheus to Warp10 metrics forwarder
Stars: ✭ 82 (-17.17%)
Mutual labels:  monitoring, metrics
Influxgraph
Graphite InfluxDB backend. InfluxDB storage finder / plugin for Graphite API.
Stars: ✭ 87 (-12.12%)
Mutual labels:  monitoring, metrics
Kamon
Distributed Tracing, Metrics and Context Propagation for application running on the JVM
Stars: ✭ 1,280 (+1192.93%)
Mutual labels:  monitoring, metrics
Infra Integrations Sdk
New Relic Infrastructure Integrations SDK
Stars: ✭ 42 (-57.58%)
Mutual labels:  monitoring, metrics
Nginx Lua Prometheus
Prometheus metric library for Nginx written in Lua
Stars: ✭ 964 (+873.74%)
Mutual labels:  monitoring, metrics
Gin Gomonitor
Gin middleware for monitoring
Stars: ✭ 59 (-40.4%)
Mutual labels:  monitoring, metrics
Go Grpc Prometheus
Prometheus monitoring for your gRPC Go servers.
Stars: ✭ 965 (+874.75%)
Mutual labels:  monitoring, metrics
Graylog Plugin Metrics Reporter
Graylog Metrics Reporter Plugins
Stars: ✭ 71 (-28.28%)
Mutual labels:  monitoring, metrics
Es Stats
ElasticSearch cluster metrics -> Graphite
Stars: ✭ 91 (-8.08%)
Mutual labels:  monitoring, metrics
Sensu Plugins Network Checks
This plugin provides native network instrumentation for monitoring and metrics collection, including: hardware, TCP response, RBLs, whois, port status, and more.
Stars: ✭ 28 (-71.72%)
Mutual labels:  monitoring, metrics
Prometheus Net
.NET library to instrument your code with Prometheus metrics
Stars: ✭ 944 (+853.54%)
Mutual labels:  monitoring, metrics
Tessera
A dashboard front-end for graphite.
Stars: ✭ 1,202 (+1114.14%)
Mutual labels:  monitoring, metrics

Yabeda::Rails

Built-in metrics for out-of-the box Rails applications monitoring.

If your monitoring system already collects Rails metrics (e.g. NewRelic) then most probably you don't need this gem.

Sample Grafana dashboard ID: 11668

Installation

Add this line to your application's Gemfile:

gem 'yabeda-rails'
# Then add monitoring system adapter, e.g.:
# gem 'yabeda-prometheus'

And then execute:

$ bundle

Registering metrics on server process start

Currently, yabeda-rails automatically registers rails metrics when a server is started via rails server, puma -C config/puma.rb or unicorn -c. However, other application servers or launching via rackup aren't supported at the moment.

A possible workaround is to detect server process and manually activate yabeda-rails in an initializer:

# config/initializers/yabeda.rb

if your_app_server_process? # Your logic here
  Yabeda::Rails.install!
end

You always can add support for your app server to lib/yabeda/rails/railtie.rb. Pull Requests are always welcome!

Metrics

  • Total web requests received: rails_requests_total
  • Web request duration: rails_request_duration (in seconds)
  • Views rendering duration: rails_view_runtime (in seconds)
  • DB request duration: rails_db_runtime (in seconds)

Hooks

  • on_controller_action: Allows to collect

    Yabeda::Rails.on_controller_action do |event, labels|
      next unless event.payload[:ext_service_runtime]
      time_in_seconds = event.payload[:ext_service_runtime] / 1000.0
      rails_ext_service_runtime.measure(labels, time_in_seconds)
    end
    

Custom tags

You can add additional tags to the existing metrics by adding custom payload to your controller.

# This block is optional but some adapters (like Prometheus) requires that all tags should be declared in advance
Yabeda.configure do
  default_tag :importance, nil
end

class ApplicationController < ActionController::Base
  def append_info_to_payload(payload)
    super
    payload[:importance] = extract_importance(params)
  end
end

append_info_to_payload is a method from ActionController::Instrumentation

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Releasing

  1. Bump version number in lib/yabeda/rails/version.rb

    In case of pre-releases keep in mind rubygems/rubygems#3086 and check version with command like Gem::Version.new(Yabeda::Rails::VERSION).to_s

  2. Fill CHANGELOG.md with missing changes, add header with version and date.

  3. Make a commit:

    git add lib/yabeda/rails/version.rb CHANGELOG.md
    version=$(ruby -r ./lib/yabeda/rails/version.rb -e "puts Gem::Version.new(Yabeda::Rails::VERSION)")
    git commit --message="${version}: " --edit
    
  4. Create annotated tag:

    git tag v${version} --annotate --message="${version}: " --edit --sign
    
  5. Fill version name into subject line and (optionally) some description (list of changes will be taken from changelog and appended automatically)

  6. Push it:

    git push --follow-tags
    
  7. You're done!

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yabeda-rb/yabeda-rails.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].