SAP HANA monitoring agent default metrics

This document describes the metrics that Google's monitoring agent for SAP HANA collects from SAP HANA. In addition, the document provides the queries that the monitoring agent uses to collect these metrics. If you prefer, you can suppress the default metrics and then use these queries to define custom metrics according to your own monitoring needs. For more information, see Defining custom queries in the SAP HANA Monitoring Agent User Guide.

Default metrics and queries

By default, Google's monitoring agent for SAP HANA gathers the following metrics from your SAP HANA database.

Total memory utilization by services

Metric Description
instance/mem_used_mb Amount of memory from the memory pool (in MiB) currently in use by all services
instance/resident_mem_used_mb Amount of memory (in MiB) used in total by all the services

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     SUM(TOTAL_MEMORY_USED_SIZE)/1024/1024 AS "mem_used_mb",
     SUM(PHYSICAL_MEMORY_SIZE)/1024/1024 AS "resident_mem_used_mb"
FROM M_SERVICE_MEMORY;

Total amount of memory used by all column tables

Metric in Stackdriver Description
instance/table_mem_used_mb Amount of memory (in MiB) used in total (sum of memory size in the main, delta, and history parts) by all column-tables

Google's monitoring agent for SAP HANA uses the following query to collect the above metric from SAP HANA:

SELECT
     SUM(MEMORY_SIZE_IN_TOTAL)/1024/1024 AS "table_mem_used_mb"
FROM M_CS_TABLES;

Resource utilization by host

Metric Description
by_server/mem_available_percent Amount of memory available to processes (in MiB)
by_server/mem_total_mb Total amount of memory (in MiB) on the server
by_server/mem_available_mb Free physical memory (in MiB) on the host
by_server/mem_used_mb Used physical memory (in MiB) on the host
by_server/swap_avail_mb Free swap memory (in MiB) on the host
by_server/swap_used_mb Used swap memory (in MiB) on the host
by_server/instance_mem_used_mb Amount from the memory pool (in MiB) that is used by instance processes
by_server/peak_instance_mem_used_mb Peak amount from the memory pool (in MiB) that has been used by instance processes
by_server/instance_mem_pool_size_mb Size of the memory pool (in MiB) for all instance processes
by_server/instance_code_size_mb Code size (in MiB), including shared libraries of instance processes
by_server/instance_shared_size_mb Shared memory size of instance processes
by_server/cpu_user_time_msec CPU time spent (in ms) in user mode
by_server/cpu_sys_time_msec CPU time spent (in ms) in kernel mode
by_server/cpu_wait_io_time_msec CPU time spent (in ms) in wait IO
by_server/cpu_idle_time_msec CPU idle time (in ms)

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     FREE_PHYSICAL_MEMORY/(FREE_PHYSICAL_MEMORY + USED_PHYSICAL_MEMORY)*100 AS "mem_available_percent",
     (FREE_PHYSICAL_MEMORY + USED_PHYSICAL_MEMORY)/1024/1024 AS "mem_total_mb",
     FREE_PHYSICAL_MEMORY/1024/1024 AS "mem_available_mb",
     USED_PHYSICAL_MEMORY/1024/1024 AS "mem_used_mb",
     FREE_SWAP_SPACE/1024/1024 AS "swap_avail_mb",
     USED_SWAP_SPACE/1024/1024 AS "swap_used_mb",
     INSTANCE_TOTAL_MEMORY_USED_SIZE/1024/1024 AS "instance_mem_used_mb",
     INSTANCE_TOTAL_MEMORY_PEAK_USED_SIZE/1024/1024 AS "peak_instance_mem_used_mb",
     INSTANCE_TOTAL_MEMORY_ALLOCATED_SIZE/1024/1024 AS "instance_mem_pool_size_mb",
     INSTANCE_CODE_SIZE/1024/1024 AS "instance_code_size_mb",
     INSTANCE_SHARED_MEMORY_ALLOCATED_SIZE/1024/1024 AS "instance_shared_size_mb",
     TOTAL_CPU_USER_TIME AS "cpu_user_time_msec",
     TOTAL_CPU_SYSTEM_TIME AS "cpu_sys_time_msec",
     TOTAL_CPU_WIO_TIME AS "cpu_wait_io_time_msec",
     TOTAL_CPU_IDLE_TIME AS "cpu_idle_time_msec"
FROM M_HOST_RESOURCE_UTILIZATION;

Amount of memory used by service components

Metric Description
by_component/mem_used_mb Amount of memory from the memory pool (in MiB) currently in use

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     COMPONENT AS "component",
     SUM(USED_MEMORY_SIZE)/1024/1024 AS "mem_used_mb"
FROM M_SERVICE_COMPONENT_MEMORY
GROUP BY HOST, COMPONENT;

Memory utilization by services

Metric Description
by_service/mem_used_mb Virtual memory size (in MiB)
by_service/virtual_mem_used_mb Physical memory size (in MiB)
by_service/resident_mem_used_mb Code size (in MiB), including shared libraries
by_service/code_size_mb Stack size (in MiB)
by_service/stack_size_mb Heap part of memory pool (in MiB)
by_service/heap_mem_allocated_mb Amount of pool heap memory in use (in MiB)
by_service/shared_mem_allocated_mb Shared memory part of memory pool (in MiB)
by_service/shared_mem_used Amount of pool shared memory in use (in MiB)
by_service/compactors_allocated_mb Part of the memory pool (in MiB) that can potentially be freed on memory shortage
by_service/compactors_freeable_mb Memory which can actually be freed (in MiB) on memory shortage
by_service/max_mem_pool_size_mb Maximum configured memory pool size (in MiB)
by_service/effective_max_mem_pool_size_mb Effective maximum memory pool size (in MiB)

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     PORT AS "port",
     SERVICE_NAME AS "service",
     TOTAL_MEMORY_USED_SIZE/1024/1024 AS "mem_used_mb",
     LOGICAL_MEMORY_SIZE/1024/1024 AS "virtual_mem_used_mb",
     PHYSICAL_MEMORY_SIZE/1024/1024 AS "resident_mem_used_mb",
     CODE_SIZE/1024/1024 AS "code_size_mb",
     STACK_SIZE/1024/1024 AS "stack_size_mb",
     HEAP_MEMORY_ALLOCATED_SIZE/1024/1024 AS "heap_mem_allocated_mb",
     HEAP_MEMORY_USED_SIZE/1024/1024 AS "heap_mem_used_mb",
     SHARED_MEMORY_ALLOCATED_SIZE/1024/1024 AS "shared_mem_allocated_mb",
     SHARED_MEMORY_USED_SIZE/1024/1024 AS "shared_mem_used",
     COMPACTORS_ALLOCATED_SIZE/1024/1024 AS "compactors_allocated_mb",
     COMPACTORS_FREEABLE_SIZE/1024/1024 AS "compactors_freeable_mb",
     ALLOCATION_LIMIT/1024/1024 AS "max_mem_pool_size_mb",
     EFFECTIVE_ALLOCATION_LIMIT/1024/1024 AS "effective_max_mem_pool_size_mb"
FROM M_SERVICE_MEMORY;

Runtime data for column tables

Metric Description
by_table/mem_total_mb Total memory used (in MiB) by main, delta, and history parts
by_table/mem_main_mb Current memory consumption (in MiB) in main
by_table/mem_delta_mb Current memory consumption (in MiB) in delta
by_table/mem_hist_main_mb Current memory consumption (in MiB) in history-main
by_table/mem_hist_delta_mb Current memory consumption (in MiB) in history-delta
by_table/est_max_mem_total_mb Estimated maximum memory consumption (in MiB)
by_table/records Record count
by_table/records_main Number of records in the main part of the table
by_table/records_delta Number of records in the delta part of the table
by_table/records_hist_main Number of records in the history-main part of the table
by_table/records_hist_delta Number of records in the history-delta part of the table
by_table/last_compressed_record_count Number of entries in main during the last optimize compression run
by_table/reads Number of read accesses
by_table/writes Number of write accesses
by_table/merges Number of delta merges

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     PORT AS "port",
     SCHEMA_NAME AS "schema",
     TABLE_NAME AS "table",
     PART_ID AS "partition",
     LOADED AS "loaded",
     IS_REPLICA AS "is_replica",
     MEMORY_SIZE_IN_TOTAL/1024/1024 AS "mem_total_mb",
     MEMORY_SIZE_IN_MAIN/1024/1024 AS "mem_main_mb",
     MEMORY_SIZE_IN_DELTA/1024/1024 AS "mem_delta_mb",
     MEMORY_SIZE_IN_HISTORY_MAIN/1024/1024 AS "mem_hist_main_mb",
     MEMORY_SIZE_IN_HISTORY_DELTA/1024/1024 AS "mem_hist_delta_mb",
     ESTIMATED_MAX_MEMORY_SIZE_IN_TOTAL/1024/1024 AS "est_max_mem_total_mb",
     RECORD_COUNT AS "records",
     RAW_RECORD_COUNT_IN_MAIN AS "records_main",
     RAW_RECORD_COUNT_IN_DELTA AS "records_delta",
     RAW_RECORD_COUNT_IN_HISTORY_MAIN AS "records_hist_main",
     RAW_RECORD_COUNT_IN_HISTORY_DELTA AS "records_hist_delta",
     LAST_COMPRESSED_RECORD_COUNT AS "last_compressed_record_count",
     READ_COUNT AS "reads",
     WRITE_COUNT AS "writes",
     MERGE_COUNT AS "merges"
FROM M_CS_TABLES;

Runtime data for column tables by schema

Metric Description
by_schema/mem_total_mb Total memory used (in MiB) by main, delta, and history parts
by_schema/mem_main_mb Current memory consumption (in MiB) in main
by_schema/mem_delta_mb Current memory consumption (in MiB) in delta
by_schema/mem_hist_main_mb Current memory consumption (in MiB) in history-main
by_schema/mem_hist_detla_mb Current memory consumption (in MiB) in history-delta
by_schema/est_max_mem_total_mb Estimated maximum memory consumption (in MiB)
by_schema/records Record count
by_schema/records_main Number of records in the main part of the tables in the schema
by_schema/records_delta Number of records in the delta part of the tables in the schema
by_schema/records_hist_main Number of records in the history-main part of the tables in the schema
by_schema/records_hist_delta Number of records in the history-delta part of the tables in the schema
by_schema/last_compressed_record_count Number of entries in main during the last optimize compression run
by_schema/reads Number of read accesses
by_schema/writes Number of write accesses
by_schema/merges Number of delta merges

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     PORT AS "port",
     SCHEMA_NAME AS "schema",
     SUM(MEMORY_SIZE_IN_TOTAL)/1024/1024 AS "mem_total_mb",
     SUM(MEMORY_SIZE_IN_MAIN)/1024/1024 AS "mem_main_mb",
     SUM(MEMORY_SIZE_IN_DELTA)/1024/1024 AS "mem_delta_mb",
     SUM(MEMORY_SIZE_IN_HISTORY_MAIN)/1024/1024 AS "mem_hist_main_mb",
     SUM(MEMORY_SIZE_IN_HISTORY_DELTA)/1024/1024 AS "mem_hist_delta_mb",
     SUM(ESTIMATED_MAX_MEMORY_SIZE_IN_TOTAL)/1024/1024 AS "est_max_mem_total_mb",
     SUM(RECORD_COUNT) AS "records",
     SUM(RAW_RECORD_COUNT_IN_MAIN) AS "records_main",
     SUM(RAW_RECORD_COUNT_IN_DELTA) AS "records_delta",
     SUM(RAW_RECORD_COUNT_IN_HISTORY_MAIN) AS "records_hist_main",
     SUM(RAW_RECORD_COUNT_IN_HISTORY_DELTA) AS "records_hist_delta",
     SUM(LAST_COMPRESSED_RECORD_COUNT) AS "last_compressed_record_count",
     SUM(READ_COUNT) AS "reads",
     SUM(WRITE_COUNT) AS "writes",
     SUM(MERGE_COUNT) AS "merges"
FROM M_CS_TABLES
GROUP BY HOST, PORT, SCHEMA_NAME;

Runtime information for all columns of column tables by table

Metric Description
by_table/mem_main_data_mb Memory utilization (in MiB) in data
by_table/mem_main_dict_mb Memory utilization (in MiB) in dict
by_table/mem_main_index_mb Memory utilization (in MiB) in index
by_table/mem_main_misc_mb Memory utilization (in MiB) in misc
by_table/mem_delta_data_mb Delta memory utilization (in MiB) in data
by_table/mem_delta_dict_mb Delta memory utilization (in MiB) in dict
by_table/mem_delta_index_mb Delta memory utilization (in MiB) in index
by_table/mem_delta_misc_mb Delta memory utilization (in MiB) in misc

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     PORT AS "port",
     SCHEMA_NAME AS "schema",
     TABLE_NAME AS "table",
     PART_ID AS "partition",
     LOADED AS "loaded",
     SUM(MAIN_MEMORY_SIZE_IN_DATA)/1024/1024 AS "mem_main_data_mb",
     SUM(MAIN_MEMORY_SIZE_IN_DICT)/1024/1024 AS "mem_main_dict_mb",
     SUM(MAIN_MEMORY_SIZE_IN_INDEX)/1024/1024 AS "mem_main_index_mb",
     SUM(MAIN_MEMORY_SIZE_IN_MISC)/1024/1024 AS "mem_main_misc_mb",
     SUM(DELTA_MEMORY_SIZE_IN_DATA)/1024/1024 AS "mem_delta_data_mb",
     SUM(DELTA_MEMORY_SIZE_IN_DICT)/1024/1024 AS "mem_delta_dict_mb",
     SUM(DELTA_MEMORY_SIZE_IN_INDEX)/1024/1024 AS "mem_delta_index_mb",
     SUM(DELTA_MEMORY_SIZE_IN_MISC)/1024/1024 AS "mem_delta_misc_mb"
FROM M_CS_ALL_COLUMNS
GROUP BY HOST, PORT, SCHEMA_NAME, TABLE_NAME, PART_ID, LOADED;

Runtime information for all columns of column-tables by schema

Metric Description
by_schema/mem_main_data_mb Memory utilization (in MiB) in data
by_schema/mem_main_dict_mb Memory utilization (in MiB) in dict
by_schema/mem_main_index_mb Memory utilization (in MiB) in index
by_schema/mem_main_misc_mb Memory utilization (in MiB) in misc
by_schema/mem_delta_data_mb Delta memory utilization (in MiB) in data
by_schema/mem_delta_dict_mb Delta memory utilization (in MiB) in dict
by_schema/mem_delta_index_mb Delta memory utilization (in MiB) in index
by_schema/mem_delta_misc_mb Delta memory utilization (in MiB) in misc

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     PORT AS "port",
     SCHEMA_NAME AS "schema",
     SUM(MAIN_MEMORY_SIZE_IN_DATA)/1024/1024 AS "mem_main_data_mb",
     SUM(MAIN_MEMORY_SIZE_IN_DICT)/1024/1024 AS "mem_main_dict_mb",
     SUM(MAIN_MEMORY_SIZE_IN_INDEX)/1024/1024 AS "mem_main_index_mb",
     SUM(MAIN_MEMORY_SIZE_IN_MISC)/1024/1024 AS "mem_main_misc_mb",
     SUM(DELTA_MEMORY_SIZE_IN_DATA)/1024/1024 AS "mem_delta_data_mb",
     SUM(DELTA_MEMORY_SIZE_IN_DICT)/1024/1024 AS "mem_delta_dict_mb",
     SUM(DELTA_MEMORY_SIZE_IN_INDEX)/1024/1024 AS "mem_delta_index_mb",
     SUM(DELTA_MEMORY_SIZE_IN_MISC)/1024/1024 AS "mem_delta_misc_mb"
FROM M_CS_ALL_COLUMNS
GROUP BY HOST, PORT, SCHEMA_NAME;

Statements with a duration longer than instance-configured threshold

Metric Description
expensive_statements/duration_msec Time elapsed (in ms) during execution of the statement
expensive_statements/records Number of records
expensive_statements/lock_waits Accumulated lock wait count
expensive_statements/lock_duration_msec Accumulated lock wait duration (in ms)
expensive_statements/cpu_time_msec CPU time (in ms) consumed to compute the statement

Google's monitoring agent for SAP HANA uses the following query to collect the above metrics from SAP HANA:

SELECT
     HOST AS "host",
     PORT AS "port",
     CONNECTION_ID AS "connection_id",
     TRANSACTION_ID AS "transaction_id",
     STATEMENT_HASH AS "statement_hash",
     DB_USER AS "db_user",
     SCHEMA_NAME AS "schema",
     APP_USER AS "app_user",
     ERROR_CODE AS "error_code",
     DURATION_MICROSEC/1000 AS "duration_msec",
     RECORDS AS "records",
     LOCK_WAIT_COUNT AS "lock_waits",
     LOCK_WAIT_DURATION/1000 AS "lock_duration_msec",
     CPU_TIME/1000 AS "cpu_time_msec"
FROM M_EXPENSIVE_STATEMENTS;
Was this page helpful? Let us know how we did:

Send feedback about...