Ignore instrumentation

Sometimes you have very large background jobs that generate thousands of repeated queries over and over again. In this case not all the information the instrumentation records is as important as elsewhere in the application.

To filter out some of these instrumentation events from being send to AppSignal you can tell the Ruby gem to stop instrumenting a block of code.

class BackgroundWorker
  def perform
    site = Site.find(1)
    10_000.times do
      Appsignal.without_instrumentation do
        site.perform_many_queries
      end
    end
  end
end

The code above will only instrument the Site.find(1) query and ignore all the queries generated by perform_many_queries.

Need more help?

Contact us and speak directly with the engineers working on AppSignal. They will help you get set up, tweak your code and make sure you get the most out of using AppSignal.

Contact us

Start a trial - 30 days free

AppSignal is a great way to monitor your Ruby, Elixir & Node.js applications. Works great with Rails, Phoenix, Express and other frameworks, with support for background jobs too. Let's improve your apps together.

Start a trial