Real-time Dashboards with OpsGenie and PowerBI

We use OpsGenie for Alert Management. Our intention is to have all alerts surfaced in OpsGenie as this gives us an end-to-end view of what’s happening in the environment. Whilst OpsGenie provides a serviceable user interface and mobile tools one thing it lacks is the ability to build dashboards to visualise the information. This week I built a solution using PowerBI.

There are many ways to do this but I did not want to build something from scratch. Ideally I wanted something that would work with minimal or no code and allow us to easily create new dashboards. Since PowerBI is my go-to for reports and dashboards I wanted to see if there was a way to get it to talk to OpsGenie. Turns out there is, with a little help from PowerAutomate.

Here’s the plan:

Streaming Datasets

You could create this solution by pushing events from OpsGenie to a database but I wanted something simple and real-time. As it happens, PowerBI provides a facility for this in the form of ‘Streaming Datasets’. Essentially this provides an API for you to push events to and then build reports on top of this store. Events can be real-time only or you can retain the history.

I started by creating a Streaming Dataset with the following fields:

You can create your Streaming Dataset from your PowerBI workspace by selecting New…Streaming Dataset and follow the prompts.

Once the Streaming Dataset is created you can post your data my making an API call. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

curl --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "[
{
\"Integration\" :\"AAAAA555555\",
\"Created\" :\"2023-05-26T11:24:08.057Z\",
\"Severity\" :\"AAAAA555555\",
\"Message\" :\"AAAAA555555\"
}
]" \
"https://api.powerbi.com/beta/XXX/datasets/XXX/rows?experience=power-bi&key=XXX"

Power Automate

The next step was to get OpsGenie to update the Streaming Dataset when a new alert was created. Whilst OpsGenie does provide an HTTP Integration it does not allow you to control the request format. I needed something that could format the request and possibly add some additional logic. Not wanting to build a custom service for this I used Power Automate.

This turned out to be quite a simple flow to build. It’s an HTTP trigger which in turn calls the built-in PowerBI connector.

OpsGenie

Last thing to do was to get OpsGenie to call the Power Automate flow when a new alert is created. This can be done by using the OpsGenie Webhook integration.

Testing

At this point we have an OpsGenie Webhook integration that will call the Power Automate flow when a new alert is created. This will, in turn, call the PowerBI Streaming Dataset passing a subset of the alert information. Let’s give it a test…

First thing to do - create a Test Alert.

Next check if the alert was received in Power Automate.

Power BI Report

At this point the data is waiting in the Streaming Dataset. All that remains is to create a Power BI Report or Dashboard on top of it.

Here’s a simple one I created showing Alerts over time as well as the details and split by team.

Next Steps

At present I get a real-time feed as new alerts are created but I would also want to remove alerts once they are closed on OpsGenie. This would allow me to create a Red-Amber-Green view of the various systems. I think this can be done by adding some additional logic to the Power Automate flow and creating a new Streaming Dataset to store the overall status. Will try this next.

  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2015-2024 Nick Mckenzie

请我喝杯咖啡吧~

支付宝
微信