For the past couple of months I’ve been slowly enhancing the capabilities of our website monitoring page. It’s displayed on a big 42″ LCD display in the middle of our office where everyone can see the latest up-to-the-minute updates in our page impressions, average page response times, number of RSS subscribers, etc. The page refreshes every ten minutes and randomly shows a group of these measures to anyone who’s interested.
And who would be interested in these boring numbers and graphs? Well, more than you’d think – it’s kind of become the new water cooler in the office. People gather round and talk about the latest peaks and valleys trying to understand the significance and what we can do as individuals (and a company) to influence them. Our CEO wanted to get people more in touch with our site’s vital business statistics and it’s definitely working. Now, I get stopped on the way to the kitchen by content editors and asked about the pre-noon spike in server load and the corresponding deterioration in site response time!
Currently Tracked Statistics
In the last few weeks I’ve reached out with curl to at least six separate systems, gathering relevant data in one easy to browse and understand monitoring page. Here’s a list:
- pingdom (API)
- Twitter (API)
- IVW Online
- eCircle Newsletter & Campaign management
- Google Webmaster tools (API)
- Google Feedburner (API)
- Google Docs (API)
And here’s a couple of screenshots:
Using the PivotalTracker API
The only 2 systems I have yet to incorporate are our Nagios monitoring system and our Pivotal Tracker backlog. To make IT work even more transparent to my colleagues, I’ve opted to get the backlog published to the monitoring page this week. PivotalTracker does have an API and it was a breeze to use.
I decided to take the easy route and generate an authorization token directly from the website to use in my PHP scripts. The most interesting API call for our monitor page was get iteration current via:
curl -H "X-TrackerToken: TOKEN" -X GET http://www.pivotaltracker.com/services/v2/projects/PROJECT_ID/iterations/current
for displaying the stories and statuses for the current iteration.
Embedding the various calls in a PHP script looked like this:
$url = "https://www.pivotaltracker.com/services/v2/projects/<prjID>/iterations/current";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-TrackerToken: <super-crazy-secret>"));
$result = curl_exec($ch); // run the whole process
$xml = simplexml_load_string($result);
$iteration = $xml->iteration->number;
$started = $xml->iteration->start;
$p_cnt = count($xml->iteration->stories->story);
for($i = 0; $i iteration->stories->story[$i];
After a bit of CSS beautification, I successfully added this to our monitoring page:
If you’re still on the fence about the utility of a prominently placed monitoring “window” for your business, I hope this article has shown you how simple and effective it is to
- generate awareness & discussion of your business’s vital statistics
- “tune in” all employees as to how the platform is being used and behaving (in order to get even faster feedback when something suspicious happens)
- easily fetch & render only the most meaningful measures together in one place
Besides all this, just think what a great asset a big screen TV is when the championship game comes on!
What APIs do you have experience in dealing with? How have you increased situation awareness about your platform within your company?