Shopify has evolved its tools and strategies for debugging production Rails applications. This includes leveraging tools like gdb and rbtrace to quickly track down issues without requiring code instrumentation and deployment. Recent advancements include using gdb to attach to running processes, set breakpoints, generate core dumps for out-of-band analysis, and retrieve Ruby call stacks to identify the source of warnings and errors. This enables faster debugging and resolution of production issues. This post details the use of various Ruby introspection methods (`#class`, `#is_a?`, `#instance_of?`, `#methods`, `#method`, `#caller`, `#instance_variables`, `::name`, `::class_variables`, `::instance_methods`, `::superclass`, `Module.nesting`, `::ancestors`, `::constants`) and debugger commands (`var`, `backtrace`, `frame`, `help`) to aid in this process.
All Shopify trails