Skip to main content

Enhanced Business Intelligence Alerting with Node-RED, Slack, and Image Render Microservice

Mikhail Volkov
Founder at Volkov Labs, Grafana Champion
Alex Simonok
Director of Engineering at Volkov Labs

At Volkov Labs, we’re passionate about pushing the boundaries of Business Intelligence (BI) through innovative tools and integrations. With the release of our Business Intelligence Platform 3.4.0, we’ve introduced the Image Render Microservice, a powerful feature that leverages Grafana dashboard variables to create dynamic visual content for alerts. When paired with Node-RED for workflow automation and Slack for team communication, this setup delivers a seamless, real-time alerting pipeline tailored for BI workflows.

In this blog post, we’ll dive into how the Image Render Microservice transforms BI alerting by generating contextual visual content, such as Grafana panel screenshots. We’ll also walk through a Node-RED workflow that integrates with Slack to deliver customized notifications, ensuring your team stays informed about critical business metrics and events.

Why Business Intelligence Alerting Matters

Business Intelligence is all about turning raw data into actionable insights. Effective alerting is a cornerstone of this process, enabling teams to monitor key metrics, detect anomalies, and respond promptly. Our latest BI platform release, combined with Grafana, Node-RED, and Slack, offers a robust solution for monitoring, alerting, and collaboration:

  • Grafana: A leading observability platform for creating dynamic, data-driven dashboards with customizable variables.
  • Business Intelligence Platform 3.4.0: Enhances alerting with support for dashboard variables and introduces the Image Render Microservice for dynamic visual content.
  • Node-RED: A low-code automation tool that connects BI alerts to communication platforms like Slack with ease.
  • Slack: A centralized hub for team communication, perfect for receiving real-time BI notifications and driving collaboration.

This powerful combination transforms complex BI data into clear, actionable notifications—complete with visual context—delivered directly to your team.

Slack Notification with Rendered Image for High Latency in Business Engines.
Slack Notification with Rendered Image for High Latency in Business Engines.

Introducing the Image Render Microservice in BI Platform 3.4.0

The Image Render Microservice, a highlight of our 3.4.0 release, redefines BI alerting by dynamically generating images based on real-time data. Using Grafana dashboard variables, it renders visual content—such as panel screenshots—that reflect the exact state of your metrics at the moment an alert is triggered.

Notification History for Alerting Events in Business Studio.
Notification History for Alerting Events in Business Studio.

Key Benefits for Business Intelligence

  • Dynamic Visuals: Generate images tailored to specific alert conditions using real-time data and dashboard variables.
  • Rich Context: Include Grafana panel screenshots in notifications for a visual snapshot of critical issues, such as high latency or sales performance drops.
  • Seamless Integration: Pair with Node-RED workflows to deliver rendered images to Slack or other communication platforms effortlessly.

This feature ensures that alerts are not just text-based but provide immediate visual insights, enabling teams to assess and act on BI events faster.

Node-RED Workflow for BI Alerting: A Closer Look

We’ve designed a Node-RED flow to process BI alerts from our platform, leverage the Image Render Microservice for visual content, and send formatted notifications to Slack. This workflow supports two scenarios:

  1. Text-Only Alerts: For quick updates on BI metrics.
  2. Image-Enhanced Alerts: For detailed context with rendered visuals, such as Grafana panel screenshots.

The flow accepts HTTP POST requests, processes payloads with dashboard variables, and incorporates error handling and debugging for reliability in BI environments.

Node-RED Workflow for BI Alerting with Slack Integration.
Node-RED Workflow for BI Alerting with Slack Integration.

Key Features of the Workflow

  • HTTP Endpoint: Listens for BI event notifications at /slack.
  • Payload Processing: Extracts Slack channel ID, message text, and image data (rendered via dashboard variables) from incoming requests.
  • Conditional Logic: Routes alerts based on whether a rendered image is included.
  • Slack API Integration: Sends messages and images using Slack’s APIs (chat.postMessage, files.getUploadURLExternal, etc.).
  • Error Handling: Ensures robustness with built-in error-catching mechanisms.
  • Debugging: Includes debug nodes for troubleshooting and optimizing BI workflows.

Breaking Down the Node-RED Workflow

Let’s explore the key components of this Node-RED flow and how it integrates with the Image Render Microservice to enhance BI alerting.

Triggering the Flow

The workflow starts with an HTTP In node (Slack Trigger /slack) that receives POST requests from the Business Intelligence Platform. These requests carry event data, including dashboard variables for channel ID, message text, and image references.

  • Input: HTTP POST request with JSON payload.
  • Output: Routes data to debug nodes (Show Payload, Show Headers) and a processing node (Prepare Payload).
Workflow from Trigger to Image Check Switch.
Workflow from Trigger to Image Check Switch.

Preparing the Payload with Dashboard Variables

The Prepare Payload function node formats the incoming BI alert data, including:

  • Slack channel ID from request headers.
  • Alert message text.
  • Image data (if available), such as a Base64-encoded screenshot rendered by the Image Render Microservice.
/**
* Panel Screenshot via Image Render Microservice
*/
let image = msg.payload.event.condition?.panelScreenshot || "";
let title = msg.payload.event.alert?.title || "BI Metric Snapshot";

/**
* Payload with Dashboard Variables
*/
msg.payload = {
channel_id: msg.req.headers.channel_id,
text: msg.payload.message,
title,
image,
};

return msg;

Routing Based on Image Availability

The Check Image switch node evaluates msg.payload.image to determine the next steps:

  • Image Present: Routes to nodes for uploading the rendered image to Slack.
  • No Image: Routes to nodes for sending a text-only BI notification.

Sending Text-Only Alerts

For text-only alerts, the Set Message function node formats the payload for Slack’s chat.postMessage API, including the channel ID and message text. Responses are handled with appropriate HTTP status codes (200 for success, 400 for failure).

/**
* Payload for BI Text Alert
*/
msg.payload = {
channel: msg.payload.channel_id,
text: msg.payload.text,
};

return msg;
Action Settings with Handlebars and Preview in Business Studio (Spanish).
Action Settings with Handlebars and Preview in Business Studio (Spanish).

Uploading Rendered Images to Slack

For alerts with images, the workflow processes the rendered content through multiple steps:

  1. Set Upload URL Payload: Converts Base64-encoded image data to a Buffer and prepares metadata like filename and type.
  2. Get Upload URL: Retrieves a temporary upload URL from Slack’s files.getUploadURLExternal API.
  3. Set Upload File Payload: Formats the upload request.
  4. Upload File to URL: Sends the image data to Slack.
  5. Complete Upload: Finalizes the upload and shares the image in the Slack channel with an accompanying message.
Workflow for Uploading Rendered Images to Slack.
Workflow for Uploading Rendered Images to Slack.

Error Handling and Debugging

A Catch node (Error Catch) captures errors in the workflow, routing them to an error response node (Error Response) with a 400 status code.

Debug nodes throughout the flow help monitor payloads and API responses, ensuring smooth operation for BI alerting.

Testing the Workflow

Inject nodes (Send Message, Send Image) enable testing of text and image-based alerts without triggering real events, simplifying development and validation.

How to Set Up BI Alerting with Node-RED and Slack

Ready to implement this powerful BI alerting workflow? Follow these steps to get started:

  1. Install Node-RED: Use our Docker Compose configuration or follow the official installation guide.
  2. Import the Flow: Import the JSON configuration from slack.json into Node-RED.
  3. Configure Slack API Token: Update the HTTP Request nodes with your Slack Bot User OAuth Token.
  4. Set Up Image Render Microservice: Ensure the Business Intelligence Platform 3.4.0 is installed and the Image Render Microservice is configured.
  5. Configure Actions and Alerts: Define actions in the Business Engine to send alerts to the Node-RED /slack endpoint, incorporating dashboard variables for dynamic rendering.
  6. Deploy and Test: Deploy the flow and use Inject nodes to verify text and image notifications in Slack.
Configure Grafana User Login and Password for Image Render Microservice.
Configure Grafana User Login and Password for Image Render Microservice.

Conclusion

With the release of Business Intelligence Platform 3.4.0, the Image Render Microservice marks a significant leap forward in BI alerting. By harnessing Grafana dashboard variables to create dynamic visual content like panel screenshots, it adds critical context to notifications. Paired with Node-RED for automation and Slack for communication, this integration enables teams to respond to BI events with speed and precision.

At Volkov Labs, we’re committed to evolving BI solutions that streamline data-driven decision-making. Have questions or want to learn more about integrating Grafana, Node-RED, and Slack into your workflows? Drop us a comment below or reach out to our team. Stay tuned for more updates, tutorials, and innovations in Business Intelligence!

We’d Love to Hear From You!

Have feedback or ideas? Get involved:

  • Questions, Features, or Bugs: Open a Zendesk ticket.
  • Join the Conversation: Subscribe to our YouTube Channel and share your thoughts in the comments.
  Enroll in Business Suite Enterprise