Questions? Feedback? powered by Olark live chat software

Introducing htail, a new debugging companion

Modern software development usually involves a lot of moving parts. If you work on a web application, you might interact with: a reverse proxy, a web server, an application server, a relational database, a key-value store, and so on.

When a problem arises, the debugging procedure starts. You follow your intuition and start searching where you think the problem lays in. Usually, it's not where you think it is, but somewhere else. What if you could have a view on your whole system while reproducing your issue? You might get the chance to see in one obscure log file where the problem lays.

After falling in this situation so many times, I decided to build a simple tool in order to read all my log files. It's called htail and it's available right now.

htail gif

By firing up htail, you get your most common log files in your terminal or your browser window. It's damn useful.

Installation and usage are described in the github page.

Automatically push your Rudder git repository

Rudder uses a git repository that stores some parts of your configuration. Rudder commits active techniques, directives, groups, rules and other stuff inside. This repository is local, and the commits are never pushed to a remote location. I wanted to have this repository pushed to a remote so that I can have a copy of it. It can always be useful.

To do so, follow these steps:

  1. Log in to your Rudder GUI.

  2. Create a new rule rudder-server-autopush that is applied to the group Root policy server

  3. Created an Enforce a file content directive instance with these parameters:

    • Path or file name: /var/rudder/configuration-repository/.git/hooks/post-commit
    • Enforce the content of the file: checked
    • Enable the creation of the file if it doesn't exist: checked
    • File content:

      mute=`git remote -v | grep rudder_origin`
      if [ "$?" -ne "0" ]
          git remote add rudder_origin 2>&1 > /dev/null
      git push rudder_origin master:master 2>&1 > /dev/null
    • Set explicit permissions applied to the file: checked
    • Permissions to apply to the file: executable for the user
    • The directive should be applied to the rule rudder-server-autopush
  4. ssh to your rudder server:

    ssh root@my_rudder_server
    # generate an ssh key in /var/lib/ncf-api-venv/.ssh/ with ssh-keygen 
    # make sure the key is accepted by your remote git server
    # don't forget to run chown ncf-api-venv: /var/lib/ncf-api-venv/.ssh/id_rsa*
    # when it's all done, do that:
    # you might need to ssh once in order to that the server to the known hosts
    rudder agent update
    rudder agent run
    cd /var/rudder/configuration-repository
    git commit --allow-empty "test commit #1" 
    # should succeed
    git commit --allow-empty "test commit #2"
    # should succeed again
  5. Look at your remote repository, and it will be updated with the commits.

4 steps to follow when creating a new Rudder category

When you want to add a custom technique to Rudder, you might want to create your own category directory.

To do so:

  • Create your directory in /var/rudder/configuration-repository/techniques/

    cd /var/rudder/configuration-repository/techniques
    mkdir foobar
    cat  foobar/category.xml
    <xml><name>My Foobar Category</name><description>My Foobar Category is Awesome</description></xml>
  • Commit it in the underlying git repository

    git add foobar
    git commit -m "Add foobar category"
  • Reload the technique library

    curl -s -f -k "https://localhost/rudder/api/techniqueLibrary/reload"
  • Check the error log in /var/log/rudder/webapp

    tail /var/log/rudder/webapp/$(date +%Y_%m_%d).*