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).
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).
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).
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 cloud costs
- Storage/Database utilization metrics
- Business metrics
- Metrics from your Tesla! (We have an integration for that)
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 firstname.lastname@example.org 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:
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).
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.