Client-managed and cloud versions of Qlik Sense support different source triggers (reload failed/stopped/succeeded) and alert destinations (email, Teams, Slack, etc).
Check each section below for information about which triggers and destinations are supported for each version.
1 - Client-managed Qlik Sense
Below follows a list of destinations to which Butler can send notifications when a reload task fails or is aborted.
A comparison of the different alert destinations can be found here.
1.1 - Alert emails
Overview of the various kinds of alert emails Butler can send.
Scheduled vs manual app reloads
It might not be obvious at first, but there are several kinds of reloads in Qlik Sense Enterprise on Windows:
Reloads started from QMC. These are usually created and managed in the QMC. Quite often they are also combined into reload chains. The common thing about these reloads is that they - under the hood - are managed by Sense’s scheduling service.
Manual reloads started from the script editor. When developing apps in the standard Sense client/script editor you usually reload the apps from there. This does trigger an app reload, but not via the Sense scheduling service. Instead the reload is done directly in the engine service.
The reload failure notifications described here work by looking at log entries written by the scheduling service. When that service writes information to the logs about a failed reload, your logging appender will detect it and send a UDP message to Butler - who will forward the message to all the notification destinations configured in the config file.
It’s also possible to have the log appender send emails without using Butler.
It works perfectly fine, but the emails will be very basic when it comes to formatting and you will not get any of the features offered by Butler (last few lines of the reload script log included in the email, customizable email subjects etc).
Alert emails
Butler can send two kinds of alert emails:
When a scheduled reload task fails.
When a running reload task is stopped.
Alert emails can be formatted using HTML, use CSS styling, emojis etc.
There’s no reason an alert email can’t look good!
Alert emails viewed on a mobile phone give direct insight into what has happened:
In a regular email client a reload failed email could look like below.
Note the end of the script - the last few lines of the reload log are often very useful when it comes to understanding what caused the reload failure.
Basic alert emails also possible
Qlik Sense Enterprise on Windows uses the log4net logging framework to create log files. Log4net is quite flexible and can - among other things - send emails when events such as reload failures occur. There is however little flexibility when it comes to layout and contents of those emails. They are text only (no formatting, tables, different fonts, colors etc) and the email subjects cannot contain any dynamic fields (for example the name of the failed reload task).
The goal of Butler’s alert emails is to address these limitations and offer a flexible foundation not only for emails, but for all kinds of alerts.
If you want to explore what’s possible using just the features offered by log4net, Christof Schwarz has a good post on sending basic notification emails when scheduled reloads fail, with links to Levi Turner’s great examples.
Alert emails to app owners
Qlik Sense can be configured in many ways. In some companies all apps are owned by a central service account.
Other companies set the developer as app owner also for published apps.
In the latter case it might be relevant to send the app owner a notification email when a reload task fails or is aborted. That way the developer is immediately made aware of the issue and can act on it as needed.
This feature assumes the app owner’s user account (in the Sense user directory) has an email address associated with it. When syncing users from Active Directory the users’ emails are often brought along into Sense, but there is no guarantee for this.
If an email address is available for a Sense user, the QMC user section can look like this:
Alert emails only for some tasks
Sometimes there is a desire to only have email alerts for some tasks.
One example can be a Sense cluster that hosts both development and production apps, maybe separated on different servers.
As of Butler 7.4.0 it is possible to control per task if an alert email should be sent when the task fails or is aborted from the QMC.
Conceptually it works like this:
Instructions for how to configure this feature is available here.
Note: This feature is similar to - but independent from - the “task specific email recipients” feature below. Either feature can be enabled or disabled independently of the other in Butler’s config file.
Task specific email recipients
They may be cases where all alert emails should normally go to for example a Sense administrator, but some alerts should instead (or also) go to some other recipients.
An example could be a sales related Sense app. If it fails reloading the standard alert email should go to the Sense administrator, but there should also be an alert email sent to the sales operations team, to notify them that they won’t find updated numbers in the Sales app.
Butler handles this scenario by using a custome propperty (its name is configurable in the Butler config file) to set alert email recipients on a per-task basis.
Conceptually it works like this:
Instructions for how to configure this feature is available here.
Note: This feature is similar to - but independent from - the “alert emails only for some tasks” feature below. Either feature can be enabled or disabled independently of the other in Butler’s config file.
How it works
Butler uses a templating engine called Handlebars. It is used when Butler sense alert emails.
The high-level system overview below shows how email (and other alert types) are sent by Butler:
Template fields
The Handlebars templating engine looks for template fields in the template files you create.
A complete list of template fields - including descriptions - is available in the Reference section.
Not all failed reloads will cause alert emails
While not obvious at first, there are different kinds of reloads taking place in a Qlik Sense Enterprise environment:
Reloads started by the Sense Scheduler service. These reloads always have a task associated with them.
Reloads started from Sense’s standard script editor. These reloads are not started by the Sense scheduler, but rather directly in the Sense engine. Progress for such reloads will therefore go to the engine logs.
The log appenders that drive Butler’s alerts rely on the Scheduler logs - not the engine logs.
This is an intentional design decision.
It is certainly possible to add log appenders also for engine logs and that way get notified when any reload fail. The question is whether that’s an interesting use case. In most cases sys admins aren’t very interested in reloads that fail during app development - they only care about failures caused by apps in production - i.e. app reload tasks managed by the Sense Scheduler. Thus, Butler currently doesn’t deal with reload failures reported from the Sense engine.
References
Qlik’s documenation around log appenders and how to hook into the Sense logs is somewhat brief, but does provide a starting point if you want to dive deeper into this topic.
The main log4net documentation (log4net is the logging framework used by Qlik Sense Enterprise) can also be useful.
These links describe how emails can be sent from the log4net logging framework itself, directly to the recipient. Butler includes sameple XML files for this use case too, but Butler takes things further by using the data in the Sense logs to pull in more data around the failed or stopped reload.
In other words - Butler’s alert emails are significantly more flexible and contain information (such as script logs) that are not availble using purely log4net.
Sending alerts to IM services like Slack and Microsoft Teams can be a great way to quickly notify people about urgent issues.
Teams, Slack and email notifications
Microsoft Teams, Slack and email are all notification destinations.
Alert messages/notifications come in two variants: “basic” and “formatted”.
Formatted messages
These messages take full advantage of the formatting available in each notification destination.
Slack has its own way for creating messages with rich layout and formatting - as does Teams and email.
Formatted messages are created using template files.
Each notification destination has its own set of template files. It’s therefore possible to take advantage of each destination’s specific features when it comes to formatting the messages sent by Butler.
Message templates can include “template fields”. These are placeholders that are replaced with actual event values before the message is sent.
The GitHub repository includes fully functional template files for all destinations.
Basic messages
Basic message formats are available for all notification destinations.
This message type is useful if you only want a short, basic notification that a task failed or was aborted. The basic formats are pre-defined and are thus easy to set up.
Microsoft Teams notifications
Basic and formatted reload task failure notifications can look like this in Teams:
The configuration needed for setting this up is described here.
Slack notifications
Basic and formatted reload task failure notifications can look like this in Teams:
The configuration needed for setting this up is described here.
1.3 - Storing script logs of failed reloads to disk
When investigating reload failures it can often be useful to have access to the entire reload log. Butler detects failed reloads and can store the entire reload log into easy to find and analyse files on disk.
Reload script logs
When doing a scheduled reload or a reload started from the QMC, Sense will create a detailed log file that includes all the commands executed during the reload.
If a reload for reason fails it can be very useful to look at these reload logs.
The latest reload log file for each reload task is available via the QMC, but logs for previous reload attempts are not available via the QMC.
Using the same mechanism used by reload failure alerts in general, Butler can be configured to store the reload logs of all failed reloads to disk.
The reload logs are stored in the directory configured in the Butler config file, with separate directories for each date:
Storing information about failed reloads in InfluxDB can be useful for monitoring and analysis purposes.
Once the data is in InfluxDB it can be visualized in Grafana or similar tools.
Visualising failed reloads in Grafana
When a reload fails, Butler can send information about the failed reload to InfluxDB.
The data stored in InfluxDB is described here.
Once the data is in InfluxDB it can be visualized in Grafana or similar tools.
Grafana has a good log viewer that can be used to visualize the data.
Note how even the script log is stored in InfluxDB, so you can see the last few lines of the reload script log in Grafana.
This makes it easy to right away see what went wrong, especially when dealing with reloads that happened a while back.
When investigating reload failures it can often be useful to have access to the entire reload log, as this usually tells immediately what went wrong.
Butler forwards a very comprehensive set of data to New Relic when a reload fails, including the failing part of the app’s script.
This means that companies using New Relic as their enterprise monitoring solution can now also use it to monitor their Qlik Sense reloads, as well as all the Sense real-time metrics provided by Butler’s sibling tool Butler SOS.
As of this wrtiting, New Relic also offers a free tier that will be more than enough for most Butler users.
It is thus possible to get started with monitoring Sense reloads in New Relic without any additional cost.
More information about how Butler integrates with New Relic can be found here.
When a reload fails, Butler can send information about the failed reload to an MQTT broker.
MQTT is a lightweight messaging protocol that is commonly used in IoT applications, but it is a mature and versatile protocol that can be used in many different scenarios.
In short, MQTT works by having a broker that clients can connect to. Clients can publish messages to the broker, and clients can subscribe to messages from the broker.
This makes MQTT a great way to integrate different systems in a publish/subscribe pattern.
By sending information about failed reloads to an MQTT broker, Butler can be integrated with any system that can consume MQTT messages - which is a lot of systems.
The information included in the MQTT message is described here.
Here is an example of how the information about a failed reload can be viewed in MQTT Explorer:
Signl4 is a mobile alerting app that offers an easy way to get started with monitoring and alerting in general, including Qlik Sense reloads via Butler’s integration with Signl4.
Mobile alerting
Signl4 has a great mobile app that can be used to receive reload-failed alerts from Butler.
It can look something like this:
More information about how Butler integrates with Signl4 can be found here.
Webhooks provide a generic way to send information about failed/aborted reloads to any system that can receive HTTP POST/PUT/GET requests.
When nothing else works
Webhooks may be somewhat limited in terms of what they can do, but their simplicity is also their strength.
When you need to send information about failed/aborted reloads to a system that doesn’t have a dedicated integration with Butler, webhooks may be a good solution.
Butler offers a lot of flexibility in terms of how each webhook is configured.
You can…
specify the URL to send the webhook to.
specify the HTTP method to use (POST, PUT, GET).
use htto or https.
specify if a custom certificate should be used.
In this case the root CA certificate is provided to Butler per webhook, which means Butler can be integrated to many systems, each using their own self-signed certificate.
specify if an untrusted certificate should be accepted.
This is useful when integrating with systems that use self-signed certificates and you don’t have access to the root CA certificate.
Sending reload-failed informnation to a GET http webhook provided by Node-RED can look like this in the Node-RED editor:
Overview of the various kinds of alert emails Butler can send when app reloads fail in Qlik Sense Cloud.
Scheduled vs manual app reloads
Qlik Sense Cloud has a few different ways to reload apps:
Scheduled reloads: Apps can be set to reload at specific times, for example every night at 3am.
Manually started reload: Right clicking an app in the Qlik Cloud web UI, then select “Reload now”. This is a manual reload and is not managed by the Sense scheduling service.
Manual reloads started from the script editor: When developing apps in the Sense client/script editor you usually reload the apps from there. This triggers an app reload too, but in a slightly different way than previous example. Instead the reload is done directly in the engine service. Butler is not notified in this case, so no alert emails are sent for these reloads.
Note
The reload failure notifications described here work in all cases except the “manual reloads started from the script editor”.
There is currently no way around that, it’s just how Qlik Cloud works.
Alert emails
Butler can send the following alert emails:
When an app reload fails.
Alert emails can be formatted using HTML, use CSS styling, emojis etc.
There’s no reason an alert email can’t look good!
Here is an example of how a failed reload alert email could look like:
Alert emails to app owners
All apps in Qlik Sense Cloud has an app owner, typically the user who created the app.
If there is an email address associated with the app owner, Butler can send an alert email to the app owner when a reload task fails or is aborted.
This feature can be turned on/off in the Butler config file.
It is also possible to only send alert emails to some app owners but not others, this page describes how to configure that.
Alert emails only for some apps
Sometimes there is a desire to only have email alerts for some aps.
Maybe some apps are critical and should always trigger an alert email when they fail, while other apps are less critical and should not trigger any alert emails.
This is possible using a tag set on apps in Qlik Sense Cloud:
Butler uses a templating engine called Handlebars. It is used when sending all kinds of alert emails supported by Butler.
For an overview of how Butler deals with alert messages for Qlik Sense Cloud, please see the setup section.
Template fields
The Handlebars templating engine looks for template fields in the template files you create.
A complete list of template fields - including descriptions - is available in the Reference section.
2.2 - Alerts via Slack and Microsoft Teams
Sending alerts to IM services like Slack and Microsoft Teams can be a great way to quickly notify people about urgent issues.
Teams, Slack and email notifications
Microsoft Teams, Slack and email are all notification destinations.
Alert messages/notifications come in two variants: “basic” and “formatted”.
Formatted messages
These messages take full advantage of the formatting available in each notification destination.
Slack has its own way for creating messages with rich layout and formatting - as does Teams and email.
Formatted messages are created using template files.
Each notification destination has its own set of template files. It’s therefore possible to take advantage of each destination’s specific features when it comes to formatting the messages sent by Butler.
Message templates can include “template fields”. These are placeholders that are replaced with actual event values before the message is sent.
The GitHub repository includes fully functional template files for all destinations.
Basic messages
Basic message formats are available for all notification destinations.
This message type is useful if you only want a short, basic notification that a task failed or was aborted. The basic formats are pre-defined and are thus easy to set up.
Microsoft Teams notifications
Basic and formatted reload task failure notifications can look like this in Teams:
The configuration needed for setting this up is described here.
Slack notifications
Basic and formatted reload task failure notifications can look like this in Teams:
The configuration needed for setting this up is described here.
2.3 - Storing script logs of failed reloads to disk
When investigating reload failures it can often be useful to have access to the entire reload log.
Butler can store complete script logs for failed app reloads on local disk, making it easy to figure out what happened without having to log into Qlik Cloud.
Reload script logs
Butler can be configured to retrieve and store the reload logs of all failed app reloads to disk.
The feature is identical to that of client-managed Qlik Sense, but those features can be individually enabled/disabled and configured.
The reload logs are stored in the directory configured in the Butler config file, with separate directories for each date: