Apirelio Ruby

Documentation · RubyGems · Apirelio

Privacy-safe customer-aware API analytics for Ruby and Rack applications.

bundle add apirelio
client = Apirelio::Client.new(
  api_key: ENV.fetch("APIRELIO_API_KEY", ""),
  service: "billing-api"
)

use Apirelio::Rack::Middleware,
  client: client,
  customer_resolver: ->(env) {
     = env["current_account"]
     && { id: .id.to_s, name: .name, plan: .plan }
  }

The middleware records the final status, duration and normalized route without collecting request or response bodies, query strings, credentials, cookies or client IP addresses. Delivery uses a bounded background queue and never changes the observed response or exception.

Use apirelio-rails for automatic Rails registration.