The project is in a healthy, maintained state
Rails integration for the Boring Metrics Ruby SDK. It provides Rails-specific functionality for the Boring Metrics API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.0
~> 13.0
~> 1.21

Runtime

 Project Readme

Boring Metrics Ruby SDK

This is a Ruby SDK for the Boring Metrics API. It provides a simple and efficient way to interact with the API from your Ruby applications.

Supported Platforms

The SDK is available for the following platforms:

Installation

Add this line to your application's Gemfile:

# For plain Ruby applications
gem 'boringmetrics'

# For Rails applications
gem 'boringmetrics-rails'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install boringmetrics
$ gem install boringmetrics-rails

Usage

Ruby

# Initialize the SDK
BoringMetrics.initialize("YOUR_API_TOKEN")

# Send a log
BoringMetrics.logs.send(
  type: "log",
  level: "info",
  message: "User signed in",
  data: { userId: "123" },
)

# Send multiple logs
BoringMetrics.logs.send_batch([
  { type: "log", level: "warn", message: "Something looks weird" },
  { type: "log", level: "error", message: "Something broke!", data: { error: "Connection timeout" } }
])

# Set a live metric value
BoringMetrics.lives.update(
  liveId: "metric-123",
  value: 42,
  operation: "set",
)

# Increment a live metric value
BoringMetrics.lives.update(
  liveId: "metric-123",
  value: 5,
  operation: "increment",
)

Rails

In a Rails application, you can initialize the SDK in an initializer:

# config/initializers/boringmetrics.rb
BoringMetrics::Rails.initialize("YOUR_API_TOKEN", {
  logsMaxBatchSize: 50,
  logsSendInterval: 10
})

The Rails integration automatically captures exceptions and logs them to BoringMetrics.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/boringmetrics/ruby-sdk.

Contributors

Thanks to everyone who contributed to the Boring Metrics Ruby SDK!

License

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