Ruby / RailsConnect your apps
Documentation / Connect / Connect your apps
Ruby / Rails
The closeyourit-ruby gem sends errors, logs, slow queries and job metrics from a Rails app.
What it collects
On its own, with Rails:
- unhandled exceptions, with the HTTP request that caused them;
- errors in background jobs (ActiveJob and Sidekiq);
- handled errors reported with
Rails.error.report; - slow queries and slow methods;
- background job metrics.
When you ask for it:
- structured logs, tied to the request by the same id;
- performance issues: N+1, too many queries, slow HTTP calls;
- usage telemetry: which parts of the app really run.
It does not collect page views or record sessions: for those you need JavaScript.
Install
# Gemfile
gem "closeyourit-ruby"
Configure
# config/initializers/closeyourit.rb
CloseYourIt.init do |c|
c.endpoint_url = "https://bugs.example.com"
c.token = ENV["CLOSEYOURIT_TOKEN"]
c.project_id = ENV["CLOSEYOURIT_PROJECT_ID"]
c.environment = Rails.env
end
Without an address, a token or a project the gem does nothing: it is safe in development and in tests.
Good to know
- Sending happens in the background: it does not slow the request and never crashes the app.
- No personal data leaves, unless you turn it on.
- In production an
http://address is refused: the token would travel in clear text.
OpenTelemetry and trace context
The native gem collects errors and performance issues. Its optional W3C propagation correlates requests; it does not turn the gem into an OTLP exporter. Use an official server-side exporter with the OpenTelemetry receiver for complete spans and general metrics. Verify the receiver is enabled before configuring it.