Tableau Server: Alert Gracefully

Some background

A while back, I wrote about how we make use of the background_jobs table in Tableau Server. You can see the code here. Although it did a great job with making our people aware of what failed (and when), it still arrived too frequently and was also sent via email. If you see something in email, it’s typically more resource intensive to take in all the bits of the message (who, when, where, what, etc.). Then you have to switch back to figure out where (in all your potential Tableau sites) the workbook/data source could be located. With the beauty of Slack and its well-documented API, we can now send the alerts via Slack messages.

Tools needed

  • Slack
  • Tableau (PostgreSQL access)
  • PowerShell

Why Alert Less?

Put simply, it avoids ‘alert fatigue’ and also gives just enough information for action; enough to glance at it and immediate know where to go and how to fix it. Rather than all hours throughout the day, this method just issues a direct message via Slack to each user. Further, it doesn’t embed an image or csv into an email (which would actually require more work). Bonus, we also remove the ‘com.tableausoftware.nativeapi.dll.DataSourceException:‘ portion of the error message. You would be surprised at how much people ignore when they are unsure about the message.

It’s a private message with four (and only 4) bits of information:

  • workbook or data source name
  • site
  • time of failure
  • friendly error message (we actually keep the most common and reply with those messages instead)
ts-alerts-0
sample Slack message to a user

The Core Query

This is it, seriously.

ts-alerts-1
The text enclosed in yellow is configurable to your environment

Getting the Slack Username/ID

This was the challenging part. The goal was to add an additional column to the query output above so when we did our notification loop in the code, we could dynamically send to the owner. This little bit made it pretty easy to just add their Slack ID to the Tableau query:

$t = curl -F token=”$($Slack)”  https://slack.com/api/users.list -k –silent

($t | ConvertFrom-Json).members | ForEach-Object -process { $sUser = $_.id ; $_} | select  @{n=’slack_username’;e={$sUser}},@{n=’profile_email’;e={$_.profile.email}}

Here’s the process for each day:

  • Split the day up into, wait for it, AM and PM.
  • Run the AM/PM code at some desired time
  • Notify each user via Slack, individually.

You may be wondering: what happens if you miss an extract during some gap? For example, what if someone’s extract failed at 11pm and we didn’t run the script until the next day? Pretty simple: if it’s run at 11pm and it is mission critical, it would be fixed at 11ish pm. We’re talking about daily (read: now) alerts. If I’m alerted today about something that happened yesterday, I’m less likely to do something about it. But there’s all sorts of psychology about that 🙂

 

One thought on “Tableau Server: Alert Gracefully

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s