Official Ruby client for CloseYourIt, the open source tracker for errors, logs, uptime and servers. Add the gem to a Rails application and it sends:
- Exceptions, in Sentry event format, to
/api/v1/projects/:id/events: grouped and triaged in the error tracker. - Slow queries and methods, to
/api/v1/projects/:id/metrics: grouped by signature with duration aggregates. - Structured logs, background job errors and metrics, handled errors and messages.
It adds request context, user, tags and breadcrumbs, sends in the background (never blocks a request, never crashes the app), is a no-op until configured and keeps PII out unless you turn it on.
# Gemfile
gem "closeyourit-ruby"In CloseYourIt, create a token in Member → Project → tokens: you get the bearer secret (shown once) and the project UUID.
# config/initializers/closeyourit.rb
CloseYourIt.init do |c|
c.endpoint_url = ENV["CLOSEYOURIT_ENDPOINT_URL"] # https://app.closeyour.it, or your own installation
c.token = ENV["CLOSEYOURIT_TOKEN"]
c.project_id = ENV["CLOSEYOURIT_PROJECT_ID"]
c.environment = Rails.env
endWithout endpoint_url, token and project_id the gem does nothing. In production an http://
endpoint is refused, because the token would travel in clear text.
Full guide, with every option, slow queries, job metrics, forking servers and privacy: closeyour.it/docs/sdk-ruby.
mise install
bundle install
bundle exec rubocop
bundle exec rspecPull requests are welcome: read CONTRIBUTING.md and CLA.md. This repository is a published copy: accepted changes are applied to the upstream source and come back here with the next release. Report vulnerabilities as described in SECURITY.md.
MIT, see LICENSE.txt.