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:installSet 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:doctorNext, 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)
endRequests, 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.rbAutomatic 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.