Same gem as the Rails integration, different setup. Drop the middleware into Sinatra, Hanami, Roda, or any Rack app and HTTP requests, ActiveRecord queries, and Sidekiq jobs are traced automatically.
1# In config.ru or your app entrypoint2require "justanalytics"34JustAnalytics.init do |c|5c.api_key = ENV["JUSTANALYTICS_API_KEY"]6c.service_name = "my-ruby-api"7c.environment = "production"8end910# Sinatra / Hanami / Roda / raw Rack —11# mount the middleware and you are done.
Sinatra to Sidekiq, one gem covers the whole stack.
Every AR query becomes a span — slow queries and N+1 problems surface in the same trace as the request that triggered them.
Mounts under Sinatra::Base.use, Hanami's middleware stack, or any Rack-compatible config.ru. Works with Puma, Falcon, Unicorn.
Unhandled exceptions and rescued errors via JustAnalytics.capture_exception. Sidekiq job failures auto-captured.
Per-thread trace context. Works under Puma's clustered + threaded workers without GIL surprises.
Add the frontend script for cookie-free analytics, replay, and Web Vitals. One dashboard for client + server.
Per-route latency, error-rate, and Sidekiq queue-depth alerts. Email, webhook, or PagerDuty.
Bundle add, init, use the middleware. Every Sinatra route is traced; Sidekiq jobs join the same trace.
# Install
bundle add justanalytics
# config.ru
require "sinatra/base"
require "justanalytics"
JustAnalytics.init do |c|
c.api_key = ENV["JUSTANALYTICS_API_KEY"]
c.service_name = "my-sinatra-app"
c.environment = "production"
end
class MyApp < Sinatra::Base
use JustAnalytics::Rack::Middleware
get "/users/:id" do
# ActiveRecord queries auto-traced
User.find(params[:id]).to_json
end
end
run MyAppReplace five tools with one platform. Start with the free tier or try Pro free for 7 days.
Start 7-Day Free Trial