Blog  /  News

Monitor your production line with the new Grafana Enterprise data source plugin for SAP HANA®

Abdelkrim Hadjidj

Abdelkrim Hadjidj 18 May 2021 5 min read

Greetings! This is Abdelkrim from the Solutions Engineering team, and I am with Sriram from the Enterprise Plugin team. We both joined Grafana Labs in February this year, and we already have some stories to share with you. 

I came to Grafana Labs from a big data and analytics background, and I witnessed a lot of companies storing monitoring and performance data in all kinds of analytics platforms (data lakes, data warehouses, cloud, etc.). Unfortunately, these analytics platforms are often isolated from the observability platforms, and data cannot be used. So I was super excited when Sriram posted in our Slack his new Grafana Enterprise data source for SAP HANA®

SAP HANA® is a high-performance, in-memory database designed for analyzing high-speed transactions. It enables all kinds of use cases where near-zero query latency over a massive dataset is required. These real-time query needs are a sweet spot for Grafana as well. 

SAP HANA® is the trademark or registered trademark of SAP SE or its affiliates in Germany and in several other countries.

With the Grafana Enterprise data source for SAP HANA®, you can visualize your SAP HANA® data alongside all of your other data sources in Grafana, as well as log and metric data in context. Yet another silo broken and a single-pane view of all your data wherever they are!

This plugin includes a built-in query editor and supports variables, complex annotations, set alerting thresholds, access control and permissions, and more. Let’s see how we can use it for monitoring the yield and quality of a production factory!


Setting up the Grafana Enterprise data source for SAP HANA® is simple and straightforward. First, you will need to download and install the plugin from our plugins page. Once you’ve installed the plugin, configure SAP HANA® as a data source by going to Configuration > Data Sources > Add data source. Select SAP HANA®. Add the server details, authentication credentials, and the schema that you want to query. An SAP HANA® schema is the equivalent of a database in traditional DBMS. Alternatively, click on the Permissions tab to enable data source permissions, an Enterprise feature that allows you to control who can query the data source. Your data source is now ready to query!

Adding variables

In our use case, we are monitoring the quality and the productivity of multiple machines in several plants spread over the world. When a quality issue is detected, the plant manager will need to slice and dice to find the root cause. So let’s extract these dimensions as template variables.

To do so, we just need to write the SQL query that retrieves the data from SAP HANA®. We need to have a hierarchy between Countries/Cities/Plants and Machines. If we select France as a country, we want only French cities in the City variable. To do so, we add the WHERE "country" IN (${Country}) to the query.

Queries and macros

We are now ready to get some data back. Let’s visualize the productivity of the machines. Productivity is defined as the total number of parts produced, whether they were accepted or rejected by the quality check system. To do this, we will write the below SQL query. The query editor is a smart auto-completion editor, allowing you to format data as table or time series.

Notice the dynamic filtering of the dashboards by defining variables and referencing them in the SQL query. We are also using the macro $__timeFilter on the column “timestamp” to focus our analysis on the time slot selected in the dashboard.

From the results, it seems that some machines are struggling compared to the others. Let’s add some time series data from sensors to see what’s happening. Now, we will execute another query to get temperature values from our machine sensors together with their timestamps. To show this data, we switch the SQL editor to the Timeseries format. Wow! There are two machines that are heating more than the others. But what triggered this change?

Annotations to the rescue

The Grafana Enterprise data source for SAP HANA® supports annotations. This overlays visual markers on any graph to correlate events in SAP HANA® (such as maintenance activities) against time series metrics from other data sources, such as the sensor data. By adding this table as an annotations source, we get very insightful contextual data.

Fortunately, all operations performed by the machine operators are logged in a separate SAP HANA® table called operations. By enabling this, we discover that our problems started to happen right after changing the raw material we are using on some machines. We found the cause!

To proactively detect such situations in the future, we can set up alerts for our SAP HANA® graphs, for instance, if the average temperature on a machine goes above a certain threshold.

Wrapping up 

That’s all for today. To find out more about the Grafana Enterprise data source for SAP HANA®, which is available for customers with a license to Grafana Enterprise, check out the plugin page and contact us for a demo

Please let us know what you think of this new plugin. We look forward to learning about the use cases you will build with it.

And if you would like to build the next plugin or help our customers use it, we are hiring across the board. This blog is a testimony that you can have an impact very quickly at Grafana Labs, as Sriram and I joined just three months ago. :)