Capturing Redirect Metrics in Rails

1 · Jeremiah Coleman · May 28, 2022, 11:59 a.m.
When you’re cleaning up a monolith Rails app, it’s essential to have usage metrics to know what pieces of code are safe to remove. Tools like Datadog APM and New Relic provide great insight on controller utilization, and Coverband shows hit rate on other areas of your code, like services and helpers. But when you’re dealing with route cleanup, there’s one piece that’s pretty elusive - redirects. Well-used monoliths tend to end up with large sections like this in config/routes.rb: get "/old-home"...