The g8scope gem builds an envelope from a Ruby exception, scrubs it and sends it with Net::HTTP. No runtime dependencies, Ruby 2.6+. The Rails adapter builds on it.
Install from GitHub. Not on RubyGems yet. Source: github.com/bliptrace/bliptrace-ruby.
Install
# Gemfile
gem "g8scope", git: "https://github.com/bliptrace/bliptrace-ruby"
Then bundle install.
Use it
require "g8scope"
client = G8Scope::Client.new(
G8Scope::Config.new(
key: ENV["BLIPTRACE_KEY"],
endpoint: "https://ingest.bliptrace.com",
environment: "production",
release: "[email protected]",
base_path: Dir.pwd, # flags in-app frames
scrub_keys: %w[password token authorization secret]
)
)
begin
do_something_risky!
rescue => e
client.capture(e, user: { id: current_user_id }, request: { method: "POST", url: "/checkout" })
raise
end
A plain Hash works too: G8Scope::Client.new(key: ENV["BLIPTRACE_KEY"], endpoint: "https://ingest.bliptrace.com").
| Option | Default |
|---|---|
key |
nil (nothing is sent) |
endpoint |
legacy host: set https://ingest.bliptrace.com |
environment |
"production" |
release |
nil |
timeout |
3 seconds |
max_frames / max_message |
30 / 2000 |
ignore_exceptions |
[] (class names) |
scrub_keys |
[] |
base_path |
"" (frames under it, outside /gems/, are in-app) |
enabled |
true |
To send after a response: envelope = client.build_envelope(e, context) then client.send_envelope(envelope) if envelope.