One gem for Rails, Rack, and Sinatra. On Rails it wires itself in through a railtie; on plain Rack you add one middleware line.
bundle add errorgapCreate config/initializers/errorgap.rb:
Errorgap.configure do |config|
config.endpoint = ENV.fetch("ERRORGAP_ENDPOINT")
config.project_slug = ENV.fetch("ERRORGAP_PROJECT_SLUG")
config.api_key = ENV.fetch("ERRORGAP_API_KEY")
endThe gem installs Rack middleware automatically and reports unhandled exceptions from every environment. To skip reporting in some environments, set config.ignore_environments = %w[test development].
In your boot file (config.ru or app.rb), configure the SDK and add the middleware before the app runs:
require "errorgap"
Errorgap.configure do |config|
config.endpoint = ENV.fetch("ERRORGAP_ENDPOINT")
config.project_slug = ENV.fetch("ERRORGAP_PROJECT_SLUG")
config.api_key = ENV.fetch("ERRORGAP_API_KEY")
end
use Errorgap::RackMiddlewareFrom rails console, a throwaway route, or a controller action:
raise "Errorgap test error"Exceptions in a request cycle are reported automatically; from a console, use Errorgap.notify(StandardError.new("Errorgap test error")).
Confirm your key and endpoint reach errorgap before wiring anything else — send one event straight to the ingestion API:
curl -sS -X POST "$ERRORGAP_ENDPOINT/api/projects/$ERRORGAP_PROJECT_SLUG/notices" \
-H "content-type: application/json" \
-H "x-errorgap-project-key: $ERRORGAP_API_KEY" \
-d '{"errors":[{"type":"ErrorgapInstallTest","message":"Errorgap install verification"}]}'A 201 with a group_id means ingestion works (202 = received but sampled; 401 = wrong key). Then trigger the test error above through the SDK. Your onboarding screen's Verify step checks the stack off automatically once the first event lands — it polls every three seconds.
Next: the full ingestion API, or browse every SDK.