Skip to content

Instantly share code, notes, and snippets.

@shime
Created February 28, 2012 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shime/1932825 to your computer and use it in GitHub Desktop.
Save shime/1932825 to your computer and use it in GitHub Desktop.
conditioning airbrake at runtime
class CustomSender < Airbrake::Sender
alias_method :orig_send, :send_to_airbrake
def send_to_airbrake(data)
return if Random.new.rand(10..20).odd?
orig_send(data)
end
end
Airbrake.sender = CustomSender.new(Airbrake.configuration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment