Project

rails_mind

0.0
The project is in a healthy, maintained state
The RailsMind client for Rails page views and request, error, job, mailer, and business-event telemetry, with optional Flipper and OpenTelemetry integrations.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.4, < 1
>= 7.2, < 9
 Project Readme

RailsMind SDK

The MIT-licensed Ruby client for RailsMind. One bounded collector for Rails page views, requests, errors, jobs, mailer attempts, Flipper observations, and selected OpenTelemetry spans. Version 0.4.1 is an early release; see compatibility and validation limits.

gem "rails_mind", "~> 0.4.0"

Install from RubyGems.org and commit your application's Gemfile.lock to pin the resolved version. This repository contains the open-source client library. The hosted RailsMind service is a separate, proprietary application; its source is not included or licensed by this repository. See development and release notes.

bundle install
bin/rails generate rails_mind:install --plan
bin/rails generate rails_mind:install

Set RAILS_MIND_KEY for the destination application environment. It is the only required setting; collection stays off without it. The endpoint defaults to https://railsmind.com. Release IDs are detected from hosting metadata or the app's deployed REVISION file; telemetry still works when none is available. RAILS_MIND_ENDPOINT and RAILS_MIND_RELEASE are optional overrides. See configuration and release detection.

With the key in the app's environment, check the effective settings. Until the key is set, doctor names it and exits non-zero.

bin/rails rails_mind:doctor

Next, run bin/rails rails_mind:verify on the app's server. Match its check ID in RailsMind Setup and wait for Check processed. Then visit the app to confirm real traffic. This command sends one labeled diagnostic check, consumes one event of quota, and leaves business/performance metrics alone. It requires a hosted app with installation-check support; rails_mind:doctor remains read-only. See the verification guide for failure states and the limits of this check.

RailsMind.with_context(user_id: current_user.id.to_s, account_id: current_account.id.to_s) do
  RailsMind.track("Invoice paid", invoice_id: invoice.id, amount_cents: invoice.amount_cents)
end

Requests, ActiveJob executions, and Action Mailer attempts share native trace context without requiring OpenTelemetry. Existing OpenTelemetry context stays authoritative. Mail observations contain class/action, timing, and attempt metadata, never recipients or rendered content; an attempt is not proof of inbox delivery. See workflow observations.

See installation and privacy and compatibility.

Connect Claude Code or Codex with bin/rails generate rails_mind:agent --plan. Choose an environment-variable API token or Rails encrypted credentials, then follow the agent setup guide from first connection to a reported PR and deployment confirmation. Requires rails_mind 0.2.0 or later.

Tests:

bundle install
bundle exec rake test
bundle exec ruby script/package_smoke.rb
ruby script_benchmark.rb

Automatic endpoint sampling is enabled by default. The hosted policy can reduce routine successful requests while preserving failed, slow, or repeated-query requests and all other signal kinds from sampling. Business/error events remain unsampled; bounded queues and delivery are still best effort. See sampling and coverage and inspect RailsMind.stats. Use a transactional outbox when durable business-event delivery is required.