Skip to main content

Transformations, thresholds, and health check updates in Business Intelligence 1.3.0

Daria Volkova
Co-Founder at Volkov Labs, Grafana Champion

We are excited to announce the release of the Business Intelligence, version 1.3.0. At this early stage, it is a proof-of-concept product, meaning a product created as a starter to vastly extend its functionality in the future. This release includes the following updates:

  • Enriched the Alerting panel with Grafana user roles.
  • Made the BI Alert Engine follow color configuration (specified in the Thresholds category).
  • Added support for transformations (beta) and multi-frames.
  • Added retry and timeout parameters for Grafana health check.
Business Intelligence 1.3.0 for Grafana.

User roles in the Alerting panel

The latest version of the Alerting panel supports user roles.

Alert rules tab

For Admins and Editors, all four action buttons are available: info, pause/resume, edit, delete. For Viewers, only two action buttons are available: info, pause/resume.

Action buttons accessibility for different Grafana roles on the Alert rules tab.
Action buttons accessibility for different Grafana roles on the Alert rules tab.

Webhooks tab

For Admins and Editors, all three action buttons are available: test, edit, delete. For Viewers, only one action button is available: test.

info

A greyed-out delete button in the Webhook tab means the alert rule with this webhook is currently active and can not be deleted.

Action buttons accessibility for different Grafana roles on the Webhooks tab.
Action buttons accessibility for different Grafana roles on the Webhooks tab.

Color range in Thresholds

To support higher high and lower low ranges, we pointed the BI Alert Engine to the Thresholds color for reading the allowable range of data. The BI Engine uses the Thresholds colors as a guide in the creation of alert records and calls the assigned webhook.

info

The allowable range of data is a way to set what is normal, not requiring anyone's attention. No alerts/actions are needed when the data is within the allowable range.

In the illustration below, three alert records have been created due to the data being outside the allowable range three times.

The alert records (annotations) are displayed on the graph as light blue highlighted areas. They highlight all time ranges when the data values (temperature, in this example) went outside the allowable range. In this example, the allowable range is from 50 to 80 (set in the Thresholds category).

info

Please note, that there are no values (no registered temperature data) between the highest peak and the lowest deep on the graph. The temperature changes abruptly from max to min.

  • The temperature for alert 1 goes from below 40 to 50.
  • The temperature for alert 2 goes from 80 to 94.7 (illustrated with a tooltip) and then from about 20.4 (illustrated with a tooltip) to 50.
  • The temperature for alert 3 goes from 80 to about 93.4 and then from about 21.1 to about 33.7.

The temperature then continues still within the not allowable interval though it is not yet alerted since the alert rules run periodically. In this example, the last time, the alert rule was challenged was 11:04:50. After the next alert rule run, the interval for alert 3 will extend and a bigger area will be highlighted with light blue (not shown here).

BI Alert Engine looks up the threshold color to create an alert record and calls the assigned webhook.
BI Alert Engine looks up the threshold color to create an alert record and calls the assigned webhook.

Transformations and Multi-frames

As you know, an alert rule is created for a particular panel on a particular dashboard.

Dashboard and panel are mandatory parameters for an alert rule.
Dashboard and panel are mandatory parameters for an alert rule.

Starting from this release, BI(G) supports multi-frame data sets. That means that the alert rule assigned to a dashboard and panel will be applied to all data frames fetched from the connected data source.

In the picture below, the panel fetches three data frames, one for each device.

  • The alert is created when at least one device temperature goes beyond the allowable range (in this example, it is device 2, yellow line).
  • The alert stops ringing when the last device temperature (in this example, it is device 3, blue line) comes back into the allowable range.
Multi-frames data set example.
Multi-frames data set example.

In addition, Grafana transformations are now also supported. However, please, note, that Grafana offers a large number of transformations, hence, there is a chance that some of them will not work correctly.

info

Support of Grafana transformation is in beta state. This is due to the number of existing transformations.

Grafana Health Check

To successfully run the BI(G) app, you need Grafana and BI Engine. In some instances, Grafana might take longer time to launch than the BI Engine. This scenario may lead to the failure of the startup health check. Simply put, if the BI Engine does not find Grafana running, it shuts itself down.

To avoid this false health check failure, we added timing parameters that determine how long the BI Engine waits before checking Grafana's active status using Grafana token and URL to connect to.

By default, the waiting is 5 seconds. You can configure that by using the parameters below.

##
## Service Account
## - Viewer permission is required to access dashboards
## - Editor permission is required to access dashboards and add Annotations
##
GRAFANA_TOKEN=SERVICE-ACCOUNT-TOKEN

##
## Grafana HTTP API
##
GRAFANA_URL=http://grafana:3000

##
## Grafana Health-Check timeout, ms
## Waiting for Grafana availability for (Timeout * Number of Retries / 1000 ) seconds
##
GRAFANA_HEALTH_CHECK_TIMEOUT=1000

##
## Grafana Health-Check number of retries
##
GRAFANA_HEALTH_CHECK_RETRY=5

Getting Started

You can download the latest release from our GitHub repository and follow this hands-on tutorial.

Metrics, Logs, CPU Usage with Business Alerting in Grafana.

Docker Compose

The docker-compose.yml file consists of the following containers:

  • Grafana includes the provisioned BI Engine data source, an Alerting panel, and a demo dashboard.
  • Timescale is required to store configuration, events, rules, etc.
  • BI Engine has a service account key to access Grafana HTTP APIs. It evaluates alert rules and calls webhooks when alert statuses change.
  • JSON webhook is a webhook example based on NodeJS, which accepts alert payload and saves it to the files for testing purposes.
  • Node-RED provides an HTTP POST endpoint and sends a Slack notification with alert details.
  • Data Generator generates test data for threshold evaluation in the demo dashboard.
docker-compose.yml
loading...

Start

When you run a docker-compose file, it launches the Grafana, Timescale, BI Engine and Webhook containers:

docker compose pull && docker compose up

Stop

Stop and remove all containers:

docker compose down

Release Notes

Features / Enhancements

  • Update Business Manager and Docker Compose configuration (#6)
  • [App] Add features access for Grafana user role.
  • [App] Update ESLint configuration and refactor.
  • [App] Add Thresholds in range.
  • [App] Remove Docker container workflow.
  • [App] Update Icons and Threshold Colors.
  • [Engine] Add calculation range thresholds.
  • [Engine] Add Transformations and Multi Frames.
  • [Engine] Add retry and timeout for grafana health check.
  • [Engine] Update ESLint configuration and packages.

Always happy to hear from you