Documentation / Ruby

Integrate a Ruby or Rails app with Logister.

The best path for Ruby projects is the logister-ruby gem. It matches the Ruby-specific setup experience in the app and is the recommended integration for Rails applications.

Before you start

Create the project with the Ruby gem integration type.

What you needWhy it matters
Project API tokenAuthenticates your app when sending events
Hosted Logister base URLUsed to build the ingest endpoint
Ruby app with BundlerLets you install and configure logister-ruby

Setup flow

Recommended installation path

  1. Create the project and generate an API key.
  2. Add logister-ruby to the application.
  3. Configure the API key and Logister ingest endpoint.
  4. Optionally enable DB metrics for performance visibility.

Tip

If you only want error capture at first, ship the base config first and add database metrics later.

Install

Add the gem

ruby
gem "logister-ruby", "~> 0.1.2"
shell
bundle install

Package links: RubyGems and GitHub.

Configure

Point the gem at your Logister project.

shell
mkdir -p config/initializers
ruby
Logister.configure do |config|
  config.api_key = ENV.fetch("LOGISTER_API_KEY")
  config.endpoint = ENV.fetch("LOGISTER_ENDPOINT")
end

The endpoint should be your hosted Logister base URL plus /api/v1/ingest_events.

Important

The API token is only shown once in project settings. Store it in your environment or secret manager before you navigate away.

Metrics

Enable DB timing metrics when needed.

ruby
Logister.configure do |config|
  config.capture_db_metrics = true
  config.db_metric_min_duration_ms = 10.0
  config.db_metric_sample_rate = 1.0
end
SettingPurpose
capture_db_metricsTurns database timing capture on
db_metric_min_duration_msFilters out very fast queries
db_metric_sample_rateControls how much query traffic is reported
Verification
Performance page checklist
transactions visible
db.query samples flowing
no missing API token errors