Going Old-School with Wavefront (or How I FaaS-ed my way to a JSON Endpoint)

Clement Pang
Aug 27, 2018 · 5 min read
Departure board (split-flap) at Hannover Hauptbahnhof (Hannover main train station), Germany.

Wavefront is a hit with SaaS companies large and small dealing with the complexities of monitoring modern public/private cloud applications giving users full-stack visibility into infrastructure, cloud, application, packaged applications (e.g. Redis, etcd, MongoDB) and even end-user behavior. While the primary interaction with the system is over the browser for most users, I decided to go nostalgic and see what we can do with Wavefront and a bit of coding (no servers required).

A typical Wavefront chart with log scale

I happened to stumble upon a company based in France called Smiirl.com from Facebook and they sell these airport flap displays (I suppose they are technically called Split-flap display: https://en.m.wikipedia.org/wiki/Split-flap_display) which allows you to not only monitor your Facebook or Instagram likes but basically anything that exposes a publicly accessible endpoint (you can secure it somewhat with a pre-shared secret but given how AWS API gateway works, it’s probably relatively safe to assume that it would be pretty hard to guess the URL).

Smiirl.com

They are a bit pricey but they let you customize the graphic on the side of the flaps and it’s quite a marvel to see when it’s delivered. You can hang it on the wall and it just needs wifi and power (Ethernet port is available and for many work places that needs wifi signin, that helps a bit).

5-digit and 7-digit custom counters
5-digit counter with Wavefront logo

Here’s the goal: display the results of a Wavefront query continuously on the Smiirl counter without hosting a single server, updating once an hour. This is not just a cost issue but rather you probably don’t want it to update all the time and end up having the room sound like an airport =p

Things you can conceivably show on the counter:

  • Number of users on the site in the last X hours
AWS Lambda with API Gateway Hooked-up to it

Enter AWS lambda, a service on AWS that anybody can sign up for and it manages all the mechanics of spinning up a server, running your code, and spinning it down. It has a free tier of 1M requests a month (as of this writing) and with AWS API gateway (which, as of this writing, charged me 2 cents for the whole month), it allows you to host a code snippet that executes a Wavefront analytics query (which, btw, can be very complex, or simple, whatever you want it to be) and update the counter. You get to choose how often Smiirl polls lambda for the results and the code snippet is really as straightforward as it can be:

You just need to replace ts(my.metric) with the Wavefront query you want (you might need to url encode it). You also need a Wavefront API token (reach out to support@wavefront.com for a role account token so that it’s not tied to a user). You also need to specify the cluster (e.g. longboard.wavefront.com). The rest of the code is pretty self-explanatory. Hooking up AWS API Gateway nets you the URL:

Setting up AWS API Gateway for the AWS Lambda Function

Finally, you plop in the URL into Smiirl.com and select how frequently you want the flaps to, well, “flap”. We chose one hour at the office since it’s pretty loud (you can fix that also by changing the query so that it reports aligned hourly summarized for instance too).

Plop in the AWS API Gateway URL and off you go!

You can always trim off a couple digits by dividing the ts() expression so you don’t really need 7 digits unless you really want it :)

I did all of this while standing in the kitchen computer after opening the box from Smiirl.com so it’s safe to say it’s relatively easy to pull this off (given that I already have an account with AWS that is, and even that is easy since you can use your Amazon.com sign-in and payment credentials to get started).

Finally, Wavefront offers a first-class integration SDK with AWS Lambda which lets you monitor beyond what CloudWatch gives you (also allows you to emit custom metrics). For Node.js you can see the instructions here. With that, you also get metrics from your AWS Lambda functions in Wavefront.


Computing has gone a long way in recent years with cloud, containers and now server-less. While server-less or FaaS is still a nascent offering (and I doubt we’ll be wholesale writing everything with it anytime soon), there are use cases that works very well — I need a URL that does 10 lines of logic every hour probably fits the bill perfectly. Not having to run, maintain, patch and pay for the server for one.

Clement Pang

Written by

Cofounder and Chief Architect at Wavefront (funded by Sequoia, SHV and Tenaya), ex-Googler, 香港人