How Time Series Data Can Serve More Than One Purpose

Here’s a pro-tip for you when you record metrics on Instrumental: anything that can be a gauge, should be a gauge.

Why is that? You can use the Instrumental Query Language to get increment data, because we record the number of times we receive your gauge calls.

Let’s say you’re recording the time it takes to complete one request on your server when a user signs up, but you also want to know how often that is happening. Rather than recording two metrics, you only need one.

In ruby, you could do this automatically with rack middleware:

Instrumental.gauge('app.request.signup.create', request_duration)

On your dashboard, you could add a graph with these two metrics:

app.request.signup.create
gauge_count(app.request.signup.create) as signups

gauge_countwill graph the number of times a gauge metric was received in a given time period. So now you know how many signups you had, and how long signups take, all from one gauge metric.

Here’s a sample graph with those two metrics with some fake data (request time in milliseconds).

graph showing request time in ms

And here’s a graph with the timing metric hidden so you can see the number of signups in a given period. It was a great time for signups!

graph showing signup counts

See you next time!

Instrumental Free Trial

Understanding what's happening with your software is only possible if you monitor it at the code layer. From agents to our metric-based pricing, we’re focused on making it easy to measure your code in real-time. Try Instrumental free for 30 days.