A pythonic example of recording metrics about ephemeral scripts with prometheus

  • Post author:
  • Post category:Prometheus

In my previous post we talked about how to record information from short lived scripts (I call them ephemeral scripts by the way) with prometheus. The example there was a script which checked the SMART status of each of the disks in a machine and reported that via pushgateway. I now want to work through a slightly more complicated example. I think you hit the limits of reporting simple values in shell scripts via curl requests fairly quickly. For example with the SMART monitoring script, SMART is capable of returning a whole heap of metrics about the performance of a disk, but we boiled that down to a single "health" value. This is largely because writing a parser for all the other values that smartctl returns would be inefficient and fragile in shell. So for this post, we're going to work through an example of how to report a variety of values from a python script. Those values could be the parsed output of smartctl, but to mix things up a bit, I'm going to use a different script I wrote recently. This new script uses the Weather Underground API to lookup weather stations near my house, and then generate…

Continue ReadingA pythonic example of recording metrics about ephemeral scripts with prometheus

Game review: Betrayal at House on the Hill

At the insistence of Uncle David, we had to try this one again after he filed a formal protest at our previous review. I must say this game went much better than last time... David: oh boy I want to be the traitor. Shit I'm not. Then I died. First loser! Mikal: this went much better than last time. I think what went wrong before was a steep learning curve coupled with a very early haunting. Second loser! AJ: both of the people I was working with were useless. A fun game, I just wish the people on my team were more useful. Matt: amazing. Would play again.

Continue ReadingGame review: Betrayal at House on the Hill

Recording performance information from short lived processes with prometheus

  • Post author:
  • Post category:Prometheus

Now that I'm recording basic statistics about the behavior of my machines, I now want to start tracking some statistics from various scripts I have lying around in cron jobs. In order to make myself sound smarter, I'm going to call these short lived scripts "ephemeral scripts" throughout this document. You're welcome. The promethean way of doing this is to have a relay process. Prometheus really wants to know where to find web servers to learn things from, and my ephemeral scripts are both not permanently around and also not running web servers. Luckily, prometheus has a thing called the pushgateway which is designed to handle this situation. I can run just one of these, and then have all my little scripts just tell it things to add to its metrics. Then prometheus regularly scrapes this one process and learns things about those scripts. Its like a game of Telephone, but for processes really. First off, let's get the pushgateway running. This is basically the same as the node_exporter from last time: $ wget https://github.com/prometheus/pushgateway/releases/download/v0.3.1/pushgateway-0.3.1.linux-386.tar.gz $ tar xvzf pushgateway-0.3.1.linux-386.tar.gz $ cd pushgateway-0.3.1.linux-386 $ ./pushgateway Let's assume once again that we're all adults and did something nicer than that involving configuration…

Continue ReadingRecording performance information from short lived processes with prometheus

Basic prometheus setup

  • Post author:
  • Post category:Prometheus

I've been playing with prometheus for monitoring. It feels quite familiar to me because its based on an internal google technology called borgmon, but I suspect that means it feels really weird to everyone else. The first thing to realize is that everything at google is a web server. Your short lived tool that copies some files around probably runs a web server. All of these web servers have built in URLs which report the progress and status of the task at hand. Prometheus is built to: scrape those web servers; aggregate the data; store the data into a time series database; and then perform dashboarding, trending and alerting on that data. The most basic example is to just export metrics for each machine on my home network. This is the easiest first step, because we don't need to build any software to do this. First off, let's install node_exporter on each machine. node_exporter is the tool which runs a web server to export metrics for each node. Everything in prometheus land is written in go, which is new to me. However, it does make running node exporter easy -- just grab the relevant binary from https://prometheus.io/download/, untar, and run.…

Continue ReadingBasic prometheus setup

Gods of Metal

  • Post author:
  • Post category:Book

In this follow-up to Command and Control, Schlosser explores the conscientious objectors and protestors who have sought to highlight not just the immorality of nuclear weapons, but the hilariously insecure state the US government stores them in. In all seriousness, we are talking grannies with heart conditions being able to break in. My only real objection to this book is that is more of a pamphlet than a book, and feels a bit like things that didn't make it into the main book. That said, it is well worth the read.

Continue ReadingGods of Metal

BonkersCon video: something introductory about radio

Michael Carden kindly gave a talk at BonkersCon about the origins of radio at my request. Tim Ansell was there during the day to record these videos with his bonkers home brew video capture hardware. Sorry about the sound quality at the end of the video. We had some issues on the day with the radio mics, so these videos were recorded with a conference microphone which did admirably as long as the speaker was facing in the right direction. There are a few of these videos that I'll post in the next little while as I have time to make sure the recording worked out (by watching the video).

Continue ReadingBonkersCon video: something introductory about radio

Game review: Guillotine

AJ, Matt and I have decided that we need to play more board games and that we should write up our thoughts about them as we play them. I've decided to keep quick notes here to keep us honest. We start with a card game named "Guillotine". AJ: A fun by simple game. Matt: Fun, but don't play it with people who over think things. Mikal: A fun game we've been playing for a while. It works well with younger kids -- I think the boys were about 6 or 7 when we started playing it with them. Play is relatively quick too, a good after dinner game before the kids bed time. Would play again.

Continue ReadingGame review: Guillotine

Event wrap up

Thanks to everyone who made Technical Topics 2016 a success. I enjoyed the talks, and I think the turnout was much better than I expected. I've also given up on convincing people to use the big boy name for the event, and have accepted that "BonkersCon" has stuck as a name. So congratulations on that! A special giant thanks to those who agreed to speak, video record the event, or flew all the way from places-that-are-not-Canberra to attend. Your commitment to a random idea is impressive to me and I appreciate your efforts more than you can imagine. I've included some photos of the event below, with almost all of these having been taken by Richard Jones, so thanks to him as well for documenting the event. Tim Ansell made some videos of the talks, and I'll put these online separately in the next day or two. Having asked attendees if they'd come to another BonkersCon, the answer was a resounding yes. So, I'm thinking mid-2017 is about the right timing, and you'll hear more details about that soon.

Continue ReadingEvent wrap up

A Walk in the Woods

  • Post author:
  • Post category:Book

I found this tale of Bill Bryson walking the Appalachian Trail (rather incompetently I must say) immensely entertaining. Well written, interesting, generally exaggerated, and leaving me with a desire to get out somewhere and walk some more. I'd strongly recommend this book to people who already care about bush walking, but have found other pursuits to occupy most of their spare time.

Continue ReadingA Walk in the Woods

End of content

No more pages to load