Slack update from pdi

November 19, 2016

Data-transform your slack channels

In my humble opinion Slack is a fantastic tool for keeping development teams aligned and informed. It has (irc supported) chat, voice calls, proper code snippet sharing but it really shines in its ability to integrate all that is important to a team.

For example we integrate:

One thing was missing

Updates from pesky long running etl-jobs, while being away from the vpn-ed carte status page. And a convenient way of updating fellow are-we-there-yet-are-we-there-yet-are-we-there-yet-are-we-there-yet- colleagues ;-).

Enter the slack incoming webhook

Slacks incoming-webhook is simple, easy to understand and can be extended to support a lot of feedback:

curl -X POST \
--data-urlencode 'payload={"text":"This is a line of text.\nAnd this is another one."}' \

Pdi can do this nicely, and posting it to a slack endpoint seems a no brainer. So for something to be usefull it has to:

Do it

A reporting transformation that delivers the very same json, but with some additions:

report to slack

Script the json with javascript:

var payload= '{' +
	'"channel": "' + channel + '",' +
    '"username": "' + username + '",' +
	'"text": "' + env + '",' +
    '"attachments": [' +
        '{' +
            '"title": "' + title + '",' +
            '"text": "' + text + '",' +
			'"fallback": "' + text + '",' +
            '"color": "' + color + '"' +
        '}' +
    ']' +

Incorperate the slack reporting into a bigger picture:

main job

Et voila, some slack updates:

on slack

Thin foil hat

This thing is updating from internal sources onto semi-public services, save to say to not stick any comprising data in those shiny new status updates…

Source kjb / ktr