DEV Community

Nicolas Maloeuvre
Nicolas Maloeuvre

Posted on

How to reduce your APM Cost with this one-liner

If the pricing of you APM is based on the number of transactions, it might interest you.

First, spot your most used transactions in the APM. In Scout, use "Highest throughput" (you will find the same in New Relic, Datadog, Librato, AppSignal, Skylight, etc) :

screenshot of Scout select input

Then, register only 1/10th of them for example. If you use ScoutAPM and Ruby on Rails, add this in the controller :

  ScoutApm::Transaction.ignore! if rand(10) > 0
Enter fullscreen mode Exit fullscreen mode

done!

Obviously, the drawback is that you will miss some data, but the "mean response time per request" should still give an honest idea of the reality.

It will depend on your needs, maybe do not use it in your main home webpage, but it can be useful to use it on that little api request that is done each time after this home webpage is loaded.

Top comments (0)