---
title: "SAP HANA® integration | Grafana Cloud documentation"
description: "Learn about SAP HANA® Grafana Cloud integration."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# SAP HANA® integration for Grafana Cloud

SAP HANA is an enterprise in-memory database designed to process large volumes of data in real time. This integration for Grafana Cloud allows users to collect metrics and trace logs for monitoring an SAP HANA system.

Metrics include CPU usage by core, disk and memory usage, network and disk throughput, average query execution time, connections, alerts, replica status and ship delay. Visualizations for the system and for individual hosts are included.

This integration supports SAP HANA 2.0 SPS06+  
This integration supports the [SUSE/hanadb\_exporter](https://github.com/SUSE/hanadb_exporter) 0.8.0+

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

This integration includes 8 useful alerts and 2 pre-built dashboards to help monitor and visualize SAP HANA® metrics and logs.

## Before you begin

In order for the integration to work properly, you must set up the [SUSE hanadb exporter](https://github.com/SUSE/hanadb_exporter) on your primary host.

Using the example config, metrics will be available on port `9668` by default.

Once deployed, Grafana Alloy will be able to scrape the endpoint.

## Install SAP HANA® integration for Grafana Cloud

1. In your Grafana Cloud stack, click **Connections** in the left-hand menu.
2. Find **SAP HANA®** and click its tile to open the integration.
3. Review the prerequisites in the **Configuration Details** tab and set up Grafana Alloy to send SAP HANA® metrics and logs to your Grafana Cloud instance.
4. Click **Install** to add this integration’s pre-built dashboards and alerts to your Grafana Cloud instance, and you can start monitoring your SAP HANA® setup.

## Configuration snippets for Grafana Alloy

### Simple mode

These snippets are configured to scrape a single SAP HANA® instance running locally with default ports.

First, **manually** copy and append the following snippets into your alloy configuration file.

### Metrics snippets

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
discovery.relabel "metrics_integrations_integrations_sap_hana" {
	targets = [{
		__address__ = "localhost:9668",
	}]

	rule {
		target_label = "instance"
		replacement  = constants.hostname
	}
}

prometheus.scrape "metrics_integrations_integrations_sap_hana" {
	targets      = discovery.relabel.metrics_integrations_integrations_sap_hana.output
	forward_to   = [prometheus.remote_write.metrics_service.receiver]
	job_name     = "integrations/sap-hana"
	metrics_path = "/"
}
```

### Logs snippets

#### linux

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
local.file_match "logs_integrations_integrations_sap_hana" {
	path_targets = [{
		__address__ = "localhost",
		__path__    = "/opt/hana/shared/*/HDB*/*/trace/*.trc",
		instance    = constants.hostname,
	}]
}

loki.source.file "logs_integrations_integrations_sap_hana" {
	targets    = local.file_match.logs_integrations_integrations_sap_hana.targets
	forward_to = [loki.write.grafana_cloud_loki.receiver]
}
```

### Advanced mode

The following snippets provide examples to guide you through the configuration process.

To instruct Grafana Alloy to scrape your SAP HANA® instances, **manually** copy and append the snippets to your alloy configuration file, then follow subsequent instructions.

### Advanced metrics snippets

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
discovery.relabel "metrics_integrations_integrations_sap_hana" {
	targets = [{
		__address__ = "localhost:9668",
	}]

	rule {
		target_label = "instance"
		replacement  = constants.hostname
	}
}

prometheus.scrape "metrics_integrations_integrations_sap_hana" {
	targets      = discovery.relabel.metrics_integrations_integrations_sap_hana.output
	forward_to   = [prometheus.remote_write.metrics_service.receiver]
	job_name     = "integrations/sap-hana"
	metrics_path = "/"
}
```

To monitor your SAP HANA® instance, you must use a [discovery.relabel](/docs/alloy/latest/reference/components/discovery.relabel/) component to discover your SAP HANA® Prometheus endpoint and apply appropriate labels, followed by a [prometheus.scrape](/docs/alloy/latest/reference/components/prometheus.scrape) component to scrape it.

Configure the following properties within each `discovery.relabel` component:

- `__address__`: The address to your SAP HANA® Prometheus metrics endpoint.
- `instance` label: `constants.hostname` sets the `instance` label to your Grafana Alloy server hostname. If that is not suitable, change it to a value uniquely identifies this SAP HANA® instance. Make sure this label value is the same for all telemetry data collected for this instance.

If you have multiple SAP HANA® servers to scrape, configure one `discovery.relabel` for each and scrape them by including each under `targets` within the `prometheus.scrape` component.

### Advanced logs snippets

#### linux

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
local.file_match "logs_integrations_integrations_sap_hana" {
	path_targets = [{
		__address__ = "localhost",
		__path__    = "/opt/hana/shared/*/HDB*/*/trace/*.trc",
		instance    = constants.hostname,
	}]
}

loki.source.file "logs_integrations_integrations_sap_hana" {
	targets    = local.file_match.logs_integrations_integrations_sap_hana.targets
	forward_to = [loki.write.grafana_cloud_loki.receiver]
}
```

To monitor your SAP HANA® instance logs, you will use a combination of the following components:

- [local.file\_match](/docs/alloy/latest/reference/components/local.file_match) defines where to find the log file to be scraped. Change the following properties according to your environment:
  
  - `__address__`: The SAP HANA® instance address
  - `__path__`: Select which trace files you would like to include with a path like `.../trace/{filename.trc, nameserver*.trc, ...}`. You can also set `__path_exclude__` patterns.
  - `instance` label: `constants.hostname` sets the `instance` label to your Grafana Alloy server hostname. If that is not suitable, change it to a value uniquely identifies this SAP HANA® instance. Make sure this label value is the same for all telemetry data collected for this instance.
- [loki.source.file](/docs/alloy/latest/reference/components/loki.source.file) sends logs to Loki.

On linux, you must add the `alloy` user to the `sapsys` group with `sudo usermod -a -G sapsys alloy`

Verify that the `/opt/hana/shared/<sid>/HDB<insnr>` directory has read permission for the `sapsys` group (with `ls -la`, or set with `chmod g+r HDB<insnr>`)

Ensure that the path from that directory to each trace log you are monitoring also has read permission set for the `sapsys` group

If you have issues with setting permissions, contact your system administrator or run Grafana Alloy as the root user.

## Dashboards

The SAP HANA® integration installs the following dashboards in your Grafana Cloud instance to help monitor your system.

- SAP HANA instance overview
- SAP HANA system overview

**SAP HANA system overview (replicas)**

**SAP HANA system overview (alerts)**

**SAP HANA instance overview (logs)**

## Alerts

The SAP HANA® integration includes the following useful alerts:

Expand table

| Alert                                   | Description                                                                  |
|-----------------------------------------|------------------------------------------------------------------------------|
| SapHanaHighCpuUtilization               | Critical: CPU utilization is high.                                           |
| SapHanaHighPhysicalMemoryUsage          | Critical: Current physical memory usage of the host is approaching capacity. |
| SapHanaMemAllocLimitBelowRecommendation | Warning: Memory allocation limit set below recommended limit.                |
| SapHanaHighMemoryUsage                  | Critical: Current SAP HANA memory usage is approaching capacity.             |
| SapHanaHighDiskUtilization              | Critical: SAP HANA disk is approaching capacity.                             |
| SapHanaHighSqlExecutionTime             | Critical: SAP HANA SQL average execution time is high.                       |
| SapHanaHighReplicationShippingTime      | Critical: SAP HANA system replication log shipping delay is high.            |
| SapHanaReplicationStatusError           | Critical: SAP HANA system replication status signifies an error.             |

## Metrics

The most important metrics provided by the SAP HANA® integration, which are used on the pre-built dashboards and Prometheus alerts, are as follows:

- hanadb\_alerts\_current\_rating
- hanadb\_connections\_total\_count
- hanadb\_cpu\_busy\_percent
- hanadb\_disk\_io\_throughput\_kb\_second
- hanadb\_disk\_total\_size\_mb
- hanadb\_disk\_total\_used\_size\_mb
- hanadb\_host\_memory\_alloc\_limit\_mb
- hanadb\_host\_memory\_physical\_total\_mb
- hanadb\_host\_memory\_resident\_mb
- hanadb\_host\_memory\_swap\_free\_mb
- hanadb\_host\_memory\_swap\_used\_mb
- hanadb\_host\_memory\_used\_total\_mb
- hanadb\_network\_receive\_rate\_kb\_per\_seconds
- hanadb\_network\_transmission\_rate\_kb\_per\_seconds
- hanadb\_schema\_used\_memory\_mb
- hanadb\_sql\_service\_elap\_per\_exec\_avg\_ms
- hanadb\_sql\_service\_lock\_per\_exec\_ms
- hanadb\_sql\_top\_time\_consumers\_mu
- hanadb\_sr\_replication
- hanadb\_sr\_ship\_delay
- hanadb\_table\_cs\_top\_mem\_total\_mb
- up

## Changelog

md ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```md
# 1.0.0 - December 2025

* Chore: Fix incorrect semver to 1.0.0. No further changes

# 0.0.3 - September 2023

* New Filter Metrics option for configuring the Grafana Agent, which saves on metrics cost by dropping any metric not used by this integration. Beware that anything custom built using metrics that are not on the snippet will stop working.
* New hostname relabel option, which applies the instance name you write on the text box to the Grafana Agent configuration snippets, making it easier and less error prone to configure this mandatory label.

# 0.0.2 - August 2023

* Add regex filter for logs datasource

# 0.0.1 - June 2023

* Initial release
```

## Cost

By connecting your SAP HANA® instance to Grafana Cloud, you might incur charges. To view information on the number of active series that your Grafana Cloud account uses for metrics included in each Cloud tier, see [Active series and dpm usage](/docs/grafana-cloud/fundamentals/active-series-and-dpm/) and [Cloud tier pricing](/products/cloud/pricing/).
