We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Sometimes it's useful to run arbitrary code inside the agent. The ScoutApm::Debug class lets us install callbacks.
ScoutApm::Debug
For instance, to log a message each time the background worker runs, you could insert this into unicorn.rb:
after_fork do |server, worker| if defined?(ScoutApm::Agent) && defined?(ScoutApm::Debug) ScoutApm::Debug.instance.register_periodic_hook do ScoutApm::Agent.instance.logger.debug("Background worker ran") end end end