25 Oct 2021

Beyond the usual rails : monitoring

Thomas Riboulet

Lead consultant

This article is aimed at Software Engineers (senior or not) working on RubyOnRails applications.

Any RubyOnRails application comes with built in tools to track many things about its performance. There are also many tools out there that can help us do that.

In this article we will review a bit how we usually go about this at Imfiny and why we do that.

Keep an eye on the fire

Any product is like a fire : you hope it will catch well, grow, heat the food or the room properly but neither grow too big nor too low nor too wild.

So, while at first you might not be worried about performance of the application you will quickly wonder if there are performance issues, where they are so you can figure out a solution.

If you take any average RoR application you will generally want to watch the response time for any endpoint it serves. This is the most outward symptom you can measure and see. This will let you know if endpoints are slow or fast within a certain context such as the number of requests per unit of time, the load of the database, the load of the servers …

You also want to know if there are errors, where they are and what they are. Some tools allow to do all that in one place, other require you to use one tool for each.

As nothing is “bad” or “good” naturally you need to define what performance is good or bad for your application or service. This is what goes within defining Service Level Objectives : what is good, bad and average. This will also help define the level of reaction your team will have.

Our choices

At Imfiny we often work with clients with small to medium sized teams (from 3 to 50 engineers). In such teams there isn’t always people familiar with infrastructure work or the time to invest into maintaining a running instance of a performance monitoring tool.

That’s why we often advise teams to pick a performance monitoring solution sold as SaaS. The good ones are easy to setup and can be used with most stacks out there, some great ones are focused on the stacks we prefer so we also advocate for those.

We generally start with AppSignal . It’s a great performance monitoring tool for Ruby applications but it’s also a great exceptions (errors) catcher and triage platform. It also works with Elixir and Node.js apps.

If the team isn’t a fan we point them towards solutions such as NewRelic and Sentry . Those two are also great but NewRelic tends to be on the expensive side of things.

Beyond the usual case

If things start to get big and there is indeed a team of people able to setup, maintain and take care of a dedicated performance monitoring software then it’s probably a great choice to go with Prometheus and Grafana. Those two have been the de facto standard of most teams out there for the last several years. There is a great ecosystem around them and while it requires some work to get things setup and dashboards running fine, it does allow the team to master and own the platform.

Got the numbers, now what ?

That’s a good question. As hinted before those numbers are only helpful if they are used to define what is good or bad for each service. This will allow the team to know when services need attention right now or when they need to prepare for some work on them soon.

Performance should help queuing future work, feeding the feedback loop with key insight about the impact of work that has been done lately :

  • Is performance still in the green ?
  • When has performance started to degrade ?
  • Has performance been getting better ?
  • In what context have we seen performance of this or that part of the product change lately ?
  • Have our latest change to a part of our stack changed performance the way we wanted ?
  • And so on ...

We can help

If you are not familiar with keeping an eye on performance it might be difficult to know how to use tools such as AppSignal or NewRelic. It might be difficult to come up with a performance strategy too. We can help with all this, contact us we can have a chat about your case and see what we can do together.

A RubyOnRails consultancy based in the EU, we build your applications and services all over the world !



© 2021. All rights reserved.