Skip to content

KPI Details

How the SAP HANA Connector connects, discovers services, and extracts KPIs.

3 min read Updated SS

How KPI Extraction Works#

Initialization (initialize())#

1. Establish a HANA connection using the following:

  • JDBC URL,
  • username, and
  • Base64-decoded password.

2. Run HANA_Connections_Statistics.sql against HANA queries M_CONNECTION_STATISTICS and M_SERVICES to discover all active services and their ports.

3. Populate host_service_mapper — for each discovered indexserver or xsengine service, insert into host_service_mapper if not already present.

4. Load hana_kpis — fetch all rows into memory; build a kpiIdentifier → id map.

5. Load a1_logscan_heal_instance_mapper — read the first record and store logscanInstanceId.

6. Load sql_file_path_mapper — fetch only rows matching the current chainId where query_status = 1.

7. Pre-load SQL file contents — read each SQL file from disc into a queryMapper (fileName → SQL string).

Extraction (extract(from, to))#

For each enabled query file in sql_file_path_mapper, follow the steps below.

1. Filter KPIs from hana_kpis, find all entries whose kpi_query_id matches query_id.

2. Route to the correct extraction method:

file_name Method HANA Source Table
NSE_Buffer fetchNSEBufferData() SYS.M_BUFFER_CACHE_STATISTICS
Data_Schema fetchDataSchema() M_TABLE_PERSISTENCE_STATISTICS, etc.
(all others) fetchKPIData() M_LOAD_HISTORY_SERVICE

3. Inject dynamic values (standard workload queries):

    • Replace ‘?’ with the formatted from timestamp (using query_date_format and hana_time_zone).
    • Replace ‘s’ with the last two digits of the service port from host_service_mapper.

4. Execute the query on the HANA JDBC connection.

5. Map result columns to KPI objects using kpi_name as the column alias:

    • Scalar KPIs (is_group=0): each row produces one LogscanLogAnalyzerKpi with a numeric value.
    • Group KPIs (is_group=1): rows are aggregated into a map (sub-key → value) keyed by VOLUME_ID (NSE) or schema/table name (Data Schema).

6. Error handling: if a scalar KPI value is negative, it is set to null, and error code E2062 is recorded.

Output#

Each extracted KPI is wrapped in an AdapterItem and returned as a List<AdapterItem>. The downstream HealKPITransformer and HealKPIGrpcLoader workers transform and push these to the Heal platform.

Minimum Setup Example#

1. Create and use the adapter database:

DROP DATABASE IF EXISTS dataadapter_saphana;
CREATE DATABASE dataadapter_saphana;
USE dataadapter_saphana;

2. Create required tables:

  • Run: adapter.sql (framework tables)
  • Run: adapter_hana_create.sql (HANA-specific tables)

3. Register the Heal instance.

INSERT INTO a1_logscan_heal_instance_mapper VALUES ('sapsrvs4hana', '299a5907-29f5-4f3b-ad77-6a242eb30d9e', '84f9ed60-6219-4e28-9840-e5286b25e18b');

4. Register the SQL query files (chain_id must match adapter config):

INSERT INTO sql_file_path_mapper VALUES
(1, 'IndexSrv_Worload_Count', 'HANA_IndexSrv_Worload_Count.sql', 'Saphana ExtractorM', 'indexserver', 1),
(3, 'IndexSrv_Worload_DataProc', 'HANA_IndexSrv_Worload_DataProc.sql', 'Saphana ExtractorM', 'indexserver', 1),
(4, 'IndexSrv_Worload_RespTime', 'HANA_IndexSrv_Worload_RespTime.sql', 'Saphana ExtractorM', 'indexserver', 1),
(5, 'XSEngine_Worload_Count', 'HANA_XSEngine_Worload_Count.sql', 'Saphana ExtractorM', 'xsengine', 1),
(6, 'XSEngine_Worload_DataProc', 'HANA_XSEngine_Worload_DataProc.sql', 'Saphana ExtractorM', 'xsengine', 1),
(7, 'XSEngine_Worload_RespTime', 'HANA_XSEngine_Worload_RespTime.sql', 'Saphana ExtractorM', 'xsengine', 1),
(8, 'NSE_Buffer', 'NSE_Buffer.sql', 'Saphana ExtractorM', ' ', 1),
(9, 'Data_Schema', 'HANA_Data_Schemas.sql', 'Saphana ExtractorM', ' ', 1);

5. Register all KPIs (see adapter_hana_insert.sql for full 85 entries):

INSERT INTO hana_kpis VALUES
(1, 'CONNECTION_COUNT', 'INDEXSERVER_CONNECTION_COUNT', 1, 0),
(2, 'TRANSACTION_COUNT', 'INDEXSERVER_TRANSACTION_COUNT', 1, 0),
-- ... (see adapter_hana_insert.sql for all 85 entries)
(83, 'Current_Size_in_GB', 8, 0),
(84, 'Max_Buffer_Size_in_GB', 8, 0),
(85, 'SIZE_GB', 9, 0);

6. host_service_mapper is populated automatically on the first run. To seed manually, execute the following command:

INSERT INTO host_service_mapper VALUES (30003, 'your-hana-host', 'indexserver'), (30007, 'your-hana-host', 'xsengine');

Viewing KPIs#

After configuring the HANA connector using the Control Center, you can view the HANA service-related KPIs in the HEAL UI.

To view the KPIs, follow the steps below.

  1. Login to the HEAL UI application by entering the Username and Password you received in your email.

  1. After successful login, the dashboard below:

  1. Choose the Account ID (1) from the drop-down and then select the application pod (2).

  1. On the Application summary page, click the HANA service in the SDM screen to view the service details of the SAP service.

  1. The Service Details screen displays the number of instances running on this service, workload KPIs, behaviour KPIs, active signals, and events. You only have access to those services mapped to applications assigned to you.

To view the instance details, click a block with events at the instance level, as shown below.

  1. The Instance Details screen displays the metrics related to that KPI category, as shown below.