From a1becc64e94299464f99a9b57ae3aacaa875e1c1 Mon Sep 17 00:00:00 2001 From: schmikei Date: Thu, 20 Nov 2025 14:12:46 -0500 Subject: [PATCH 1/2] wip SAP HANA mixin modernization --- sap-hana-mixin/alerts.libsonnet | 138 ++ sap-hana-mixin/alerts/alerts.libsonnet | 147 -- sap-hana-mixin/config.libsonnet | 56 +- sap-hana-mixin/dashboards.libsonnet | 114 ++ .../dashboards/dashboards.libsonnet | 2 - .../sap-hana-instance-overview.libsonnet | 1237 ---------------- .../sap-hana-system-overview.libsonnet | 1125 --------------- .../sap-hana-instance-overview.json | 1258 ++++++----------- .../dashboards_out/sap-hana-logs.json | 326 +++++ .../sap-hana-system-overview.json | 1075 +++++--------- sap-hana-mixin/g.libsonnet | 1 + sap-hana-mixin/jsonnetfile.json | 53 +- sap-hana-mixin/links.libsonnet | 25 + sap-hana-mixin/main.libsonnet | 47 + sap-hana-mixin/mixin.libsonnet | 35 +- sap-hana-mixin/panels.libsonnet | 395 ++++++ .../prometheus_alerts.yaml | 30 +- sap-hana-mixin/rows.libsonnet | 85 ++ sap-hana-mixin/signals/instance.libsonnet | 163 +++ sap-hana-mixin/signals/performance.libsonnet | 66 + sap-hana-mixin/signals/system.libsonnet | 221 +++ 21 files changed, 2480 insertions(+), 4119 deletions(-) create mode 100644 sap-hana-mixin/alerts.libsonnet delete mode 100644 sap-hana-mixin/alerts/alerts.libsonnet create mode 100644 sap-hana-mixin/dashboards.libsonnet delete mode 100644 sap-hana-mixin/dashboards/dashboards.libsonnet delete mode 100644 sap-hana-mixin/dashboards/sap-hana-instance-overview.libsonnet delete mode 100644 sap-hana-mixin/dashboards/sap-hana-system-overview.libsonnet create mode 100644 sap-hana-mixin/dashboards_out/sap-hana-logs.json create mode 100644 sap-hana-mixin/g.libsonnet create mode 100644 sap-hana-mixin/links.libsonnet create mode 100644 sap-hana-mixin/main.libsonnet create mode 100644 sap-hana-mixin/panels.libsonnet create mode 100644 sap-hana-mixin/rows.libsonnet create mode 100644 sap-hana-mixin/signals/instance.libsonnet create mode 100644 sap-hana-mixin/signals/performance.libsonnet create mode 100644 sap-hana-mixin/signals/system.libsonnet diff --git a/sap-hana-mixin/alerts.libsonnet b/sap-hana-mixin/alerts.libsonnet new file mode 100644 index 000000000..0e57cba62 --- /dev/null +++ b/sap-hana-mixin/alerts.libsonnet @@ -0,0 +1,138 @@ +{ + new(this): { + local config = this.config, + groups: [ + { + name: 'sap-hana-alerts', + rules: [ + { + alert: 'SapHanaHighCpuUtilization', + expr: ||| + sum without (database_name) (hanadb_cpu_busy_percent{%(filteringSelector)s}) > %(alertsCriticalHighCpuUsage)s + ||| % config, + 'for': '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'CPU utilization is high.', + description: ( + 'The CPU usage is at {{ printf "%%.2f" $value }}%% on {{$labels.core}} on {{$labels.host}} which is above the threshold of %(alertsCriticalHighCpuUsage)s%%.' + ) % config, + }, + }, + { + alert: 'SapHanaHighPhysicalMemoryUsage', + expr: ||| + 100 * sum without (database_name)(hanadb_host_memory_resident_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) > %(alertsCriticalHighPhysicalMemoryUsage)s + ||| % config, + 'for': '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'Current physical memory usage of the host is approaching capacity.', + description: ( + 'The physical memory usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighPhysicalMemoryUsage)s%%.' + ) % config, + }, + }, + { + alert: 'SapHanaMemAllocLimitBelowRecommendation', + expr: ||| + 100 * sum without (database_name) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) < %(alertsWarningLowMemAllocLimit)s + ||| % config, + 'for': '5m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'Memory allocation limit set below recommended limit.', + description: ( + 'The memory allocation limit is set at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is below the recommended value of %(alertsWarningLowMemAllocLimit)s%%.' + ) % config, + }, + }, + { + alert: 'SapHanaHighMemoryUsage', + expr: ||| + 100 * sum without (database_name) (hanadb_host_memory_used_total_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) > %(alertsCriticalHighMemoryUsage)s + ||| % config, + 'for': '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'Current SAP HANA memory usage is approaching capacity.', + description: ( + 'The memory usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighMemoryUsage)s%%.' + ) % config, + }, + }, + { + alert: 'SapHanaHighDiskUtilization', + expr: ||| + 100 * sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_used_size_mb{%(filteringSelector)s}) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb{%(filteringSelector)s}) > %(alertsCriticalHighDiskUtilization)s + ||| % config, + 'for': '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'SAP HANA disk is approaching capacity.', + description: ( + 'The disk usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(filteringSelector)s%%.' + ) % config, + }, + }, + { + alert: 'SapHanaHighSqlExecutionTime', + expr: ||| + avg without (database_name, port, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{%(filteringSelector)s}) / 1000 > %(alertsCriticalHighSqlExecutionTime)s + ||| % config, + 'for': '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'SAP HANA SQL average execution time is high.', + description: ( + 'The average SQL execution time is at {{ printf "%%.2f" $value }}s on {{$labels.host}} which is above the threshold of %(alertsCriticalHighSqlExecutionTime)ss.' + ) % config, + }, + }, + { + alert: 'SapHanaHighReplicationShippingTime', + expr: ||| + avg without (database_name, port, secondary_port, replication_mode) (hanadb_sr_ship_delay{%(filteringSelector)s}) > %(alertsCriticalHighReplicationShippingTime)s + ||| % config, + 'for': '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'SAP HANA system replication log shipping delay is high.', + description: ( + 'The average system replication log shipping delay is at {{ printf "%%.2f" $value }}s from primary site {{$labels.site_name}} to replica site {{$labels.secondary_site_name}} which is above the threshold of %(alertsCriticalHighReplicationShippingTime)ss.' + ) % config, + }, + }, + { + alert: 'SapHanaReplicationStatusError', + expr: ||| + hanadb_sr_replication{%(filteringSelector)s} == 4 + ||| % config, + 'for': '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'SAP HANA system replication status signifies an error.', + description: 'The replication status of replica {{$labels.secondary_site_name}} is ERROR', + }, + }, + ], + }, + ], + }, +} diff --git a/sap-hana-mixin/alerts/alerts.libsonnet b/sap-hana-mixin/alerts/alerts.libsonnet deleted file mode 100644 index 880defefa..000000000 --- a/sap-hana-mixin/alerts/alerts.libsonnet +++ /dev/null @@ -1,147 +0,0 @@ -{ - prometheusAlerts+:: { - groups+: [ - { - name: 'sap-hana-alerts', - rules: [ - { - alert: 'SapHanaHighCpuUtilization', - expr: ||| - sum without (database_name) (hanadb_cpu_busy_percent) > %(alertsCriticalHighCpuUsage)s - ||| % $._config, - 'for': '5m', - labels: { - severity: 'critical', - }, - annotations: { - summary: 'CPU utilization is high.', - description: - ( - 'The CPU usage is at {{$labels.value}}%% on {{$labels.core}} on {{$labels.host}} which is above the threshold of %(alertsCriticalHighCpuUsage)s%%.' - ) % $._config, - }, - }, - { - alert: 'SapHanaHighPhysicalMemoryUsage', - expr: ||| - 100 * sum without (database_name)(hanadb_host_memory_resident_mb) / sum without (database_name) (hanadb_host_memory_physical_total_mb) > %(alertsCriticalHighPhysicalMemoryUsage)s - ||| % $._config, - 'for': '5m', - labels: { - severity: 'critical', - }, - annotations: { - summary: 'Current physical memory usage of the host is approaching capacity.', - description: - ( - 'The physical memory usage is at {{$labels.value}}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighPhysicalMemoryUsage)s%%.' - ) % $._config, - }, - }, - { - alert: 'SapHanaMemAllocLimitBelowRecommendation', - expr: ||| - 100 * sum without (database_name) (hanadb_host_memory_alloc_limit_mb) / sum without (database_name) (hanadb_host_memory_physical_total_mb) < %(alertsWarningLowMemAllocLimit)s - ||| % $._config, - 'for': '5m', - labels: { - severity: 'warning', - }, - annotations: { - summary: 'Memory allocation limit set below recommended limit.', - description: - ( - 'The memory allocation limit is set at {{$labels.value}}%% on {{$labels.host}} which is below the recommended value of %(alertsWarningLowMemAllocLimit)s%%.' - ) % $._config, - }, - }, - { - alert: 'SapHanaHighMemoryUsage', - expr: ||| - 100 * sum without (database_name) (hanadb_host_memory_used_total_mb) / sum without (database_name) (hanadb_host_memory_alloc_limit_mb) > %(alertsCriticalHighMemoryUsage)s - ||| % $._config, - 'for': '5m', - labels: { - severity: 'critical', - }, - annotations: { - summary: 'Current SAP HANA memory usage is approaching capacity.', - description: - ( - 'The memory usage is at {{$labels.value}}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighMemoryUsage)s%%.' - ) % $._config, - }, - }, - { - alert: 'SapHanaHighDiskUtilization', - expr: ||| - 100 * sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_used_size_mb) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb) > %(alertsCriticalHighDiskUtilization)s - ||| % $._config, - 'for': '5m', - labels: { - severity: 'critical', - }, - annotations: { - summary: 'SAP HANA disk is approaching capacity.', - description: - ( - 'The disk usage is at {{$labels.value}}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighDiskUtilization)s%%.' - ) % $._config, - }, - }, - { - alert: 'SapHanaHighSqlExecutionTime', - expr: ||| - avg without (database_name, port, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms) / 1000 > %(alertsCriticalHighSqlExecutionTime)s - ||| % $._config, - 'for': '5m', - labels: { - severity: 'critical', - }, - annotations: { - summary: 'SAP HANA SQL average execution time is high.', - description: - ( - 'The average SQL execution time is at {{$labels.value}}s on {{$labels.host}} which is above the threshold of %(alertsCriticalHighSqlExecutionTime)ss.' - ) % $._config, - }, - }, - { - alert: 'SapHanaHighReplicationShippingTime', - expr: ||| - avg without (database_name, port, secondary_port, replication_mode) (hanadb_sr_ship_delay) > %(alertsCriticalHighReplicationShippingTime)s - ||| % $._config, - 'for': '5m', - labels: { - severity: 'critical', - }, - annotations: { - summary: 'SAP HANA system replication log shipping delay is high.', - description: - ( - 'The average system replication log shipping delay is at {{$labels.value}}s from primary site {{$labels.site_name}} to replica site {{$labels.secondary_site_name}} which is above the threshold of %(alertsCriticalHighReplicationShippingTime)ss.' - ) % $._config, - }, - }, - { - alert: 'SapHanaReplicationStatusError', - expr: ||| - hanadb_sr_replication == 4 - ||| % $._config, - 'for': '5m', - labels: { - severity: 'critical', - }, - annotations: { - summary: 'SAP HANA system replication status signifies an error.', - description: - ( - 'The replication status of replica {{$labels.secondary_site_name}} is ERROR' - ) % $._config, - }, - }, - ], - }, - ], - }, -} diff --git a/sap-hana-mixin/config.libsonnet b/sap-hana-mixin/config.libsonnet index f655233c7..2df903483 100644 --- a/sap-hana-mixin/config.libsonnet +++ b/sap-hana-mixin/config.libsonnet @@ -1,19 +1,43 @@ { - _config+:: { - dashboardTags: ['sap-hana-mixin'], - dashboardPeriod: 'now-1h', - dashboardTimezone: 'default', - dashboardRefresh: '1m', - - // alerts thresholds - alertsCriticalHighCpuUsage: 80, // percent 0-100 - alertsCriticalHighPhysicalMemoryUsage: 80, // percent 0-100 - alertsWarningLowMemAllocLimit: 90, // percent 0-100 - alertsCriticalHighMemoryUsage: 80, // percent 0-100 - alertsCriticalHighDiskUtilization: 80, //percent 0-100 - alertsCriticalHighSqlExecutionTime: 1, // second - alertsCriticalHighReplicationShippingTime: 1, //second - - enableLokiLogs: true, + local this = self, + + // Filtering and label configuration + filteringSelector: 'job="integrations/sap-hana"', + + groupLabels: ['job', 'sid'], + instanceLabels: ['host'], + + // Dashboard configuration + uid: 'sap-hana', + dashboardNamePrefix: 'SAP HANA', + dashboardTags: ['sap-hana-mixin'], + dashboardPeriod: 'now-1h', + dashboardTimezone: 'default', + dashboardRefresh: '1m', + + // Alert thresholds + alertsCriticalHighCpuUsage: 80, // percent 0-100 + alertsCriticalHighPhysicalMemoryUsage: 80, // percent 0-100 + alertsWarningLowMemAllocLimit: 90, // percent 0-100 + alertsCriticalHighMemoryUsage: 80, // percent 0-100 + alertsCriticalHighDiskUtilization: 80, // percent 0-100 + alertsCriticalHighSqlExecutionTime: 1, // second + alertsCriticalHighReplicationShippingTime: 1, // second + + // Loki logs configuration + enableLokiLogs: true, + extraLogLabels: ['level'], + logsVolumeGroupBy: 'level', + showLogsVolume: true, + + + // Metrics source for signals + metricsSource: 'prometheus', + + // Signal definitions + signals: { + system: (import './signals/system.libsonnet')(this), + instance: (import './signals/instance.libsonnet')(this), + performance: (import './signals/performance.libsonnet')(this), }, } diff --git a/sap-hana-mixin/dashboards.libsonnet b/sap-hana-mixin/dashboards.libsonnet new file mode 100644 index 000000000..074ad89f1 --- /dev/null +++ b/sap-hana-mixin/dashboards.libsonnet @@ -0,0 +1,114 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; +local logslib = import 'logs-lib/logs/main.libsonnet'; + + +{ + local root = self, + new(this):: + local prefix = this.config.dashboardNamePrefix; + local links = this.grafana.links; + local tags = this.config.dashboardTags; + local uid = this.config.uid; + local vars = this.grafana.variables; + local annotations = this.grafana.annotations; + local refresh = this.config.dashboardRefresh; + local period = this.config.dashboardPeriod; + local timezone = this.config.dashboardTimezone; + local root = self; + + { + 'sap-hana-system-overview.json': + g.dashboard.new(prefix + ' system overview') + + g.dashboard.withDescription('SAP HANA system overview') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels( + [ + this.grafana.rows.systemReplicationRow, + this.grafana.rows.systemResourcesRow, + this.grafana.rows.systemIORow, + this.grafana.rows.systemPerformanceRow, + this.grafana.rows.systemAlertsRow, + ] + ) + ) + ) + root.applyCommon( + vars.multiInstance, + uid + '-system-overview', + tags, + links, + annotations, + timezone, + refresh, + period, + ), + + 'sap-hana-instance-overview.json': + g.dashboard.new(prefix + ' instance overview') + + g.dashboard.withDescription('SAP HANA instance overview') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels( + [ + this.grafana.rows.instanceResourcesRow, + this.grafana.rows.instanceIORow, + this.grafana.rows.instancePerformanceRow, + this.grafana.rows.instanceAlertsRow, + this.grafana.rows.instanceOutliersRow, + ] + ) + ) + ) + root.applyCommon( + vars.multiInstance, + uid + '-instance-overview', + tags, + links, + annotations, + timezone, + refresh, + period, + ), + } + if this.config.enableLokiLogs then { + 'sap-hana-logs.json': + logslib.new( + prefix + ' logs', + datasourceName=this.grafana.variables.datasources.loki.name, + datasourceRegex=this.grafana.variables.datasources.loki.regex, + filterSelector=this.config.filteringSelector, + labels=this.config.groupLabels + this.config.extraLogLabels, + formatParser=null, + showLogsVolume=this.config.showLogsVolume, + ) + { + dashboards+: + { + logs+: + root.applyCommon(super.logs.templating.list, uid=uid + '-logs', tags=tags, links=links { couchdbLogs+:: {} }, annotations=annotations, timezone=timezone, refresh=refresh, period=period), + }, + panels+: + { + logs+: + g.panel.logs.options.withEnableLogDetails(true) + + g.panel.logs.options.withShowTime(false) + + g.panel.logs.options.withWrapLogMessage(false), + }, + variables+: { + toArray+: [ + this.grafana.variables.datasources.prometheus { hide: 2 }, + ], + }, + }.dashboards.logs, + } else {}, + + applyCommon(vars, uid, tags, links, annotations, timezone, refresh, period): + g.dashboard.withTags(tags) + + g.dashboard.withUid(uid) + + g.dashboard.withLinks(std.objectValues(links)) + + g.dashboard.withTimezone(timezone) + + g.dashboard.withRefresh(refresh) + + g.dashboard.time.withFrom(period) + + g.dashboard.withVariables(vars) + + g.dashboard.withAnnotations(std.objectValues(annotations)) + + g.dashboard.graphTooltip.withSharedCrosshair(), +} diff --git a/sap-hana-mixin/dashboards/dashboards.libsonnet b/sap-hana-mixin/dashboards/dashboards.libsonnet deleted file mode 100644 index 17151e24c..000000000 --- a/sap-hana-mixin/dashboards/dashboards.libsonnet +++ /dev/null @@ -1,2 +0,0 @@ -(import 'sap-hana-system-overview.libsonnet') + -(import 'sap-hana-instance-overview.libsonnet') diff --git a/sap-hana-mixin/dashboards/sap-hana-instance-overview.libsonnet b/sap-hana-mixin/dashboards/sap-hana-instance-overview.libsonnet deleted file mode 100644 index 76ccdd46b..000000000 --- a/sap-hana-mixin/dashboards/sap-hana-instance-overview.libsonnet +++ /dev/null @@ -1,1237 +0,0 @@ -local g = (import 'grafana-builder/grafana.libsonnet'); -local grafana = (import 'grafonnet/grafana.libsonnet'); -local dashboard = grafana.dashboard; -local template = grafana.template; -local prometheus = grafana.prometheus; - -local dashboardUid = 'sap-hana-instance-overview'; - -local promDatasourceName = 'prometheus_datasource'; -local lokiDatasourceName = 'loki_datasource'; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local lokiDatasource = { - uid: '${%s}' % lokiDatasourceName, -}; - -local cpuUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, core) (hanadb_cpu_busy_percent{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - core {{core}}', - ), - ], - type: 'timeseries', - title: 'CPU usage', - description: 'CPU usage percentage of the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local diskUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - '100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{job=~"$job", sid=~"$sid", host=~"$host"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'timeseries', - title: 'Disk usage', - description: 'Disk utilization percentage of the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local physicalMemoryUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - '100 * sum by (job, sid, host) (hanadb_host_memory_resident_mb{job=~"$job", sid=~"$sid", host=~"$host"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - resident', - ), - prometheus.target( - '100 * sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~"$job", sid=~"$sid", host=~"$host"}) / clamp_min(sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~"$job", sid=~"$sid", host=~"$host"} + hanadb_host_memory_swap_free_mb{job=~"$job", sid=~"$sid", host=~"$host"}), 1)', - datasource=promDatasource, - legendFormat='{{host}} - swap', - ), - ], - type: 'timeseries', - title: 'Physical memory usage', - description: 'Physical memory utilization percentage of the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local schemaMemoryUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, database_name, schema_name) (hanadb_schema_used_memory_mb{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - {{database_name}} - {{schema_name}}', - ), - ], - type: 'timeseries', - title: 'Schema memory usage', - description: 'Total used memory by schema in the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decmbytes', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local networkIOThroughputPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, interface) (hanadb_network_receive_rate_kb_per_seconds{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - {{interface}} - receive', - ), - prometheus.target( - 'sum by (job, sid, host, interface) (hanadb_network_transmission_rate_kb_per_seconds{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - {{interface}} - transmit', - ), - ], - type: 'timeseries', - title: 'Network I/O throughput', - description: 'Network I/O throughput for the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local diskIOThroughputPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, disk) (hanadb_disk_io_throughput_kb_second{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - {{disk}}', - ), - ], - type: 'timeseries', - title: 'Disk I/O throughput', - description: 'Disk throughput for the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local connectionsPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, connection_type, connection_status)(hanadb_connections_total_count{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - {{connection_type}} - {{connection_status}}', - ), - ], - type: 'timeseries', - title: 'Connections', - description: 'Number of connections grouped by type and status in the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - fixedColor: 'blue', - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, - pluginVersion: '9.5.2-cloud.1.f9fd074b', -}; - -local averageQueryExecutionTimePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'avg by (job, sid, host, service, sql_type) ( hanadb_sql_service_elap_per_exec_avg_ms{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - {{service}} - {{sql_type}}', - ), - ], - type: 'timeseries', - title: 'Average query execution time', - description: 'Average elapsed time per execution by service and SQL type in the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ms', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'none', - }, - }, - pluginVersion: '9.5.0-cloud.5.a016665c', -}; - -local averageLockWaitExecutionTimePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, service, sql_type) (hanadb_sql_service_lock_per_exec_ms{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - {{service}} - {{sql_type}}', - ), - ], - type: 'timeseries', - title: 'Average lock wait execution time', - description: 'Average lock wait time per execution by service and SQL type in the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ms', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, - pluginVersion: '9.5.0-cloud.5.a016665c', -}; - -local alertsRow = { - datasource: promDatasource, - targets: [], - type: 'row', - title: 'Alerts', - collapsed: false, -}; - -local alertsPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host) (hanadb_alerts_current_rating{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'stat', - title: 'Alerts', - description: 'Count of the SAP HANA instance’s current alerts', - fieldConfig: { - defaults: { - color: { - fixedColor: 'yellow', - mode: 'thresholds', - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'green', - value: 0, - }, - { - color: '#EAB839', - value: 1, - }, - ], - }, - }, - overrides: [], - }, - options: { - colorMode: 'value', - graphMode: 'none', - justifyMode: 'center', - orientation: 'auto', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - textMode: 'auto', - }, - pluginVersion: '9.5.2-cloud.2.0cb5a501', -}; - -local recentAlertsPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'hanadb_alerts_current_rating{job=~"$job", sid=~"$sid", host=~"$host"}', - datasource=promDatasource, - legendFormat='{{alert_details}} {{alert_useraction}}', - format='table', - ), - ], - type: 'table', - title: 'Recent alerts', - description: 'Table of the recent SAP HANA current alerts in the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - align: 'center', - cellOptions: { - type: 'auto', - }, - inspect: false, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - }, - overrides: [], - }, - options: { - cellHeight: 'sm', - footer: { - countRows: false, - fields: '', - reducer: [ - 'sum', - ], - show: false, - }, - showHeader: true, - }, - pluginVersion: '9.5.2-cloud.2.0cb5a501', - transformations: [ - { - id: 'organize', - options: { - excludeByName: { - Value: true, - __name__: true, - alert_timestamp: true, - database_name: true, - host: true, - insnr: true, - instance: true, - job: true, - port: true, - sid: true, - }, - indexByName: { - Time: 2, - Value: 12, - __name__: 3, - alert_details: 0, - alert_timestamp: 4, - alert_useraction: 1, - database_name: 5, - host: 6, - insnr: 7, - instance: 8, - job: 9, - port: 10, - sid: 11, - }, - renameByName: { - Time: '', - alert_details: 'Details', - alert_useraction: 'Action', - port: '', - }, - }, - }, - { - id: 'groupBy', - options: { - fields: { - Action: { - aggregations: [], - operation: 'groupby', - }, - Details: { - aggregations: [], - operation: 'groupby', - }, - Time: { - aggregations: [ - 'lastNotNull', - ], - operation: 'aggregate', - }, - }, - }, - }, - { - id: 'organize', - options: { - excludeByName: {}, - indexByName: {}, - renameByName: { - 'Time (lastNotNull)': 'Time (last fired)', - }, - }, - }, - ], -}; - -local outliersRow = { - datasource: promDatasource, - targets: [], - type: 'row', - title: 'Outliers', - collapsed: false, -}; - -local topTablesByMemoryPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, database_name, table_name, schema_name)(topk(5, hanadb_table_cs_top_mem_total_mb{job=~"$job", sid=~"$sid", host=~"$host"}))', - datasource=promDatasource, - legendFormat='{{host}} - {{database_name}} - {{schema_name}} - {{table_name}}', - ), - ], - type: 'timeseries', - title: 'Top tables by memory', - description: 'Top tables by the sum of memory size in the main, delta, and history parts for the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decmbytes', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, - pluginVersion: '9.5.0-cloud.5.a016665c', -}; - -local topSQLQueriesByAverageTimePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, sql_hash) (hanadb_sql_top_time_consumers_mu{job=~"$job", sid=~"$sid", host=~"$host"})', - datasource=promDatasource, - legendFormat='{{host}} - hash: {{sql_hash}}', - ), - ], - type: 'timeseries', - title: 'Top SQL queries by average time', - description: 'Top statements by time consumed over all executions for the SAP HANA instance', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'µs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, - pluginVersion: '9.5.0-cloud.5.a016665c', -}; - -local traceLogsPanel = { - datasource: lokiDatasource, - targets: [ - { - datasource: lokiDatasource, - editorMode: 'code', - expr: '{filename=~"/opt/hana/shared/.*/HDB.*/.*/trace/.*.trc"} |=``', - queryType: 'range', - refId: 'A', - }, - ], - type: 'logs', - title: 'Trace logs', - description: 'Recent trace logs as collected from SAP HANA.', - options: { - dedupStrategy: 'none', - enableLogDetails: true, - prettifyLogMessage: false, - showCommonLabels: false, - showLabels: false, - showTime: false, - sortOrder: 'Descending', - wrapLogMessage: false, - }, - pluginVersion: '9.5.0-cloud.5.a016665c', -}; - -{ - grafanaDashboards+:: { - 'sap-hana-instance-overview.json': - dashboard.new( - 'SAP HANA instance overview', - time_from='%s' % $._config.dashboardPeriod, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - description='', - uid=dashboardUid, - ) - - .addLink(grafana.link.dashboards( - asDropdown=false, - title='Other SAP HANA dashboards', - includeVars=true, - keepTime=true, - tags=($._config.dashboardTags), - )) - - .addTemplates( - std.flattenArrays([ - [ - template.datasource( - promDatasourceName, - 'prometheus', - null, - label='Data Source', - refresh='load' - ), - ], - if $._config.enableLokiLogs then [ - template.datasource( - lokiDatasourceName, - 'loki', - null, - label='Loki Datasource', - refresh='load' - ), - ] else [], - [ - template.new( - 'job', - promDatasource, - 'label_values(hanadb_cpu_busy_percent,job)', - label='Job', - refresh=1, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'sid', - promDatasource, - 'label_values(hanadb_cpu_busy_percent,sid)', - label='SAP HANA system', - refresh=1, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'host', - promDatasource, - 'label_values(hanadb_cpu_busy_percent,host)', - label='SAP HANA instance', - refresh=1, - includeAll=true, - multi=false, - allValues='', - sort=0 - ), - ], - ]) - ) - .addPanels( - std.flattenArrays([ - [ - cpuUsagePanel { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, - diskUsagePanel { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, - physicalMemoryUsagePanel { gridPos: { h: 6, w: 12, x: 0, y: 6 } }, - schemaMemoryUsagePanel { gridPos: { h: 6, w: 12, x: 12, y: 6 } }, - networkIOThroughputPanel { gridPos: { h: 6, w: 12, x: 0, y: 12 } }, - diskIOThroughputPanel { gridPos: { h: 6, w: 12, x: 12, y: 12 } }, - connectionsPanel { gridPos: { h: 6, w: 8, x: 0, y: 18 } }, - averageQueryExecutionTimePanel { gridPos: { h: 6, w: 8, x: 8, y: 18 } }, - averageLockWaitExecutionTimePanel { gridPos: { h: 6, w: 8, x: 16, y: 18 } }, - alertsRow { gridPos: { h: 1, w: 24, x: 0, y: 24 } }, - alertsPanel { gridPos: { h: 6, w: 7, x: 0, y: 25 } }, - recentAlertsPanel { gridPos: { h: 6, w: 17, x: 7, y: 25 } }, - outliersRow { gridPos: { h: 1, w: 24, x: 0, y: 31 } }, - topTablesByMemoryPanel { gridPos: { h: 6, w: 12, x: 0, y: 32 } }, - topSQLQueriesByAverageTimePanel { gridPos: { h: 6, w: 12, x: 12, y: 32 } }, - ], - if $._config.enableLokiLogs then [ - traceLogsPanel { gridPos: { h: 6, w: 24, x: 0, y: 38 } }, - ] else [], - [ - ], - ]) - ), - - }, -} diff --git a/sap-hana-mixin/dashboards/sap-hana-system-overview.libsonnet b/sap-hana-mixin/dashboards/sap-hana-system-overview.libsonnet deleted file mode 100644 index 23129ac59..000000000 --- a/sap-hana-mixin/dashboards/sap-hana-system-overview.libsonnet +++ /dev/null @@ -1,1125 +0,0 @@ -local g = (import 'grafana-builder/grafana.libsonnet'); -local grafana = (import 'grafonnet/grafana.libsonnet'); -local dashboard = grafana.dashboard; -local template = grafana.template; -local prometheus = grafana.prometheus; - -local dashboardUid = 'sap-hana-system-overview'; - -local promDatasourceName = 'prometheus_datasource'; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local replicaStatusPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'hanadb_sr_replication{job=~"$job", sid=~"$sid"}', - datasource=promDatasource, - legendFormat='{{secondary_site_name}}', - ), - ], - type: 'stat', - title: 'Replica status', - description: 'State of the replicas in the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'thresholds', - }, - mappings: [ - { - options: { - '0': { - color: 'green', - index: 0, - text: 'ACTIVE', - }, - '1': { - color: 'yellow', - index: 1, - text: 'INITIALIZING', - }, - '2': { - color: 'yellow', - index: 2, - text: 'SYNCING', - }, - '3': { - color: 'red', - index: 3, - text: 'UNKNOWN', - }, - '4': { - color: 'red', - index: 4, - text: 'ERROR', - }, - '99': { - color: 'red', - index: 5, - text: 'UNMAPPED', - }, - }, - type: 'value', - }, - ], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'green', - value: 0, - }, - { - color: 'yellow', - value: 1, - }, - { - color: 'red', - value: 3, - }, - ], - }, - }, - overrides: [], - }, - options: { - colorMode: 'value', - graphMode: 'none', - justifyMode: 'center', - orientation: 'auto', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - textMode: 'auto', - }, - pluginVersion: '9.5.2-cloud.2.0cb5a501', -}; - -local averageReplicationShipDelayPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'avg by (job, sid, secondary_site_name) (hanadb_sr_ship_delay{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{secondary_site_name}}', - ), - ], - type: 'timeseries', - title: 'Average replication ship delay', - description: 'Average system replication log shipping delay in the SAP HANA system ', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 1, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local cpuUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host, core) (hanadb_cpu_busy_percent{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}} - core {{core}}', - ), - ], - type: 'timeseries', - title: 'CPU usage', - description: 'CPU usage percentage of the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineStyle: { - fill: 'solid', - }, - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local diskUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - '100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{job=~"$job", sid=~"$sid"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'timeseries', - title: 'Disk usage', - description: 'Disk utilization percentage of the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local physicalMemoryUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - '100 * sum by (job, sid, host) (hanadb_host_memory_resident_mb{job=~"$job", sid=~"$sid"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}} - resident', - ), - prometheus.target( - '100 * sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~"$job", sid=~"$sid"}) / clamp_min(sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~"$job", sid=~"$sid"} + hanadb_host_memory_swap_free_mb{job=~"$job", sid=~"$sid"}), 1)', - datasource=promDatasource, - legendFormat='{{host}} - swap', - ), - ], - type: 'timeseries', - title: 'Physical memory usage', - description: 'Physical memory utilization percentage of the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local sapHANAMemoryUsagePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - '100 * sum by (job, sid, host) (hanadb_host_memory_used_total_mb{job=~"$job", sid=~"$sid"}) / sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'timeseries', - title: 'SAP HANA memory usage', - description: 'Total amount of used memory by processes in the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'line', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local networkIOThroughputPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host) (hanadb_network_receive_rate_kb_per_seconds{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}} - receive', - ), - prometheus.target( - 'sum by (job, sid, host) (hanadb_network_transmission_rate_kb_per_seconds{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}} - transmit', - ), - ], - type: 'timeseries', - title: 'Network I/O throughput', - description: 'Network I/O throughput in the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local diskIOThroughputPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host) (hanadb_disk_io_throughput_kb_second{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'timeseries', - title: 'Disk I/O throughput', - description: 'Disk throughput for the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local averageQueryExecutionTimePanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'avg by (job, sid, host, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}} - service: {{service}} - type: {{sql_type}}', - ), - ], - type: 'timeseries', - title: 'Average query execution time', - description: 'Average elapsed time per execution across the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ms', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local activeConnectionsPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host) (hanadb_connections_total_count{job=~"$job", sid=~"$sid", connection_status=~"RUNNING|QUEUING"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'stat', - title: 'Active connections', - description: 'Number of connections in active states across the SAP HANA system', - fieldConfig: { - defaults: { - color: { - fixedColor: 'blue', - mode: 'fixed', - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - }, - overrides: [], - }, - options: { - colorMode: 'value', - graphMode: 'none', - justifyMode: 'center', - orientation: 'auto', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - textMode: 'auto', - }, - pluginVersion: '9.5.2-cloud.2.0cb5a501', -}; - -local idleConnectionsPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host) (hanadb_connections_total_count{job=~"$job", sid=~"$sid", connection_status=~"IDLE"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'stat', - title: 'Idle connections', - description: 'Number of connections in the idle state across the SAP HANA system', - fieldConfig: { - defaults: { - color: { - fixedColor: 'blue', - mode: 'fixed', - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - }, - overrides: [], - }, - options: { - colorMode: 'value', - graphMode: 'none', - justifyMode: 'center', - orientation: 'auto', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - textMode: 'auto', - }, - pluginVersion: '9.5.2-cloud.2.0cb5a501', -}; - -local alertsRow = { - datasource: promDatasource, - targets: [], - type: 'row', - title: 'Alerts', - collapsed: false, -}; - -local alertsPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by (job, sid, host) (hanadb_alerts_current_rating{job=~"$job", sid=~"$sid"})', - datasource=promDatasource, - legendFormat='{{host}}', - ), - ], - type: 'stat', - title: 'Alerts', - description: 'Count of the SAP HANA current alerts in the SAP HANA system', - fieldConfig: { - defaults: { - color: { - fixedColor: 'yellow', - mode: 'thresholds', - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'green', - value: 0, - }, - { - color: '#EAB839', - value: 1, - }, - ], - }, - }, - overrides: [], - }, - options: { - colorMode: 'value', - graphMode: 'none', - justifyMode: 'center', - orientation: 'auto', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - textMode: 'auto', - }, - pluginVersion: '9.5.2-cloud.2.0cb5a501', -}; - -local recentAlertsPanel = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'hanadb_alerts_current_rating{job=~"$job", sid=~"$sid"}', - datasource=promDatasource, - format='table', - ), - ], - type: 'table', - title: 'Recent alerts', - description: 'Table of the recent SAP HANA current alerts in the SAP HANA system', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - align: 'center', - cellOptions: { - type: 'auto', - }, - filterable: false, - inspect: false, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - }, - overrides: [], - }, - options: { - cellHeight: 'sm', - footer: { - countRows: false, - enablePagination: false, - fields: '', - reducer: [ - 'sum', - ], - show: false, - }, - frameIndex: 4, - showHeader: true, - }, - pluginVersion: '9.5.2-cloud.2.0cb5a501', - transformations: [ - { - id: 'organize', - options: { - excludeByName: { - Time: false, - Value: true, - __name__: true, - alert_details: false, - alert_timestamp: true, - database_name: true, - host: true, - insnr: true, - instance: true, - job: true, - port: true, - sid: true, - }, - indexByName: { - Time: 2, - Value: 12, - __name__: 4, - alert_details: 0, - alert_timestamp: 3, - alert_useraction: 1, - database_name: 5, - host: 6, - insnr: 7, - instance: 8, - job: 9, - port: 10, - sid: 11, - }, - renameByName: { - alert_details: 'Details', - alert_timestamp: '', - alert_useraction: 'Action', - database_name: '', - }, - }, - }, - { - id: 'groupBy', - options: { - fields: { - Action: { - aggregations: [], - operation: 'groupby', - }, - Details: { - aggregations: [], - operation: 'groupby', - }, - Time: { - aggregations: [ - 'lastNotNull', - ], - operation: 'aggregate', - }, - }, - }, - }, - { - id: 'organize', - options: { - excludeByName: {}, - indexByName: {}, - renameByName: { - Action: '', - 'Time (lastNotNull)': 'Time (last fired)', - }, - }, - }, - ], -}; - -{ - grafanaDashboards+:: { - 'sap-hana-system-overview.json': - dashboard.new( - 'SAP HANA system overview', - time_from='%s' % $._config.dashboardPeriod, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - description='', - uid=dashboardUid, - ) - - .addLink(grafana.link.dashboards( - asDropdown=false, - title='Other SAP HANA dashboards', - includeVars=true, - keepTime=true, - tags=($._config.dashboardTags), - )) - - .addTemplates( - [ - template.datasource( - promDatasourceName, - 'prometheus', - null, - label='Data Source', - refresh='load' - ), - template.new( - 'job', - promDatasource, - 'label_values(hanadb_cpu_busy_percent,job)', - label='Job', - refresh=1, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'sid', - promDatasource, - 'label_values(hanadb_cpu_busy_percent,sid)', - label='SAP HANA system', - refresh=1, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - ] - ) - .addPanels( - [ - replicaStatusPanel { gridPos: { h: 6, w: 9, x: 0, y: 0 } }, - averageReplicationShipDelayPanel { gridPos: { h: 6, w: 15, x: 9, y: 0 } }, - cpuUsagePanel { gridPos: { h: 6, w: 12, x: 0, y: 6 } }, - diskUsagePanel { gridPos: { h: 6, w: 12, x: 12, y: 6 } }, - physicalMemoryUsagePanel { gridPos: { h: 6, w: 12, x: 0, y: 12 } }, - sapHANAMemoryUsagePanel { gridPos: { h: 6, w: 12, x: 12, y: 12 } }, - networkIOThroughputPanel { gridPos: { h: 6, w: 12, x: 0, y: 18 } }, - diskIOThroughputPanel { gridPos: { h: 6, w: 12, x: 12, y: 18 } }, - averageQueryExecutionTimePanel { gridPos: { h: 6, w: 12, x: 0, y: 24 } }, - activeConnectionsPanel { gridPos: { h: 6, w: 6, x: 12, y: 24 } }, - idleConnectionsPanel { gridPos: { h: 6, w: 6, x: 18, y: 24 } }, - alertsRow { gridPos: { h: 1, w: 24, x: 0, y: 30 } }, - alertsPanel { gridPos: { h: 6, w: 6, x: 0, y: 31 } }, - recentAlertsPanel { gridPos: { h: 6, w: 18, x: 6, y: 31 } }, - ] - ), - - }, -} diff --git a/sap-hana-mixin/dashboards_out/sap-hana-instance-overview.json b/sap-hana-mixin/dashboards_out/sap-hana-instance-overview.json index 31b455a7a..587ecff20 100644 --- a/sap-hana-mixin/dashboards_out/sap-hana-instance-overview.json +++ b/sap-hana-mixin/dashboards_out/sap-hana-instance-overview.json @@ -1,117 +1,106 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, + "description": "SAP HANA instance overview", + "graphTooltip": 1, "links": [ { - "asDropdown": false, - "icon": "external link", + "asDropdown": true, "includeVars": true, "keepTime": true, "tags": [ "sap-hana-mixin" ], - "targetBlank": false, - "title": "Other SAP HANA dashboards", - "type": "dashboards", - "url": "" + "title": "All dashboards", + "type": "dashboards" + }, + { + "keepTime": true, + "title": "SAP HANA instance overview", + "type": "link", + "url": "/d/sap-hana-instance-overview" + }, + { + "keepTime": true, + "title": "SAP HANA logs", + "type": "link", + "url": "/d/sap-hana-logs" + }, + { + "keepTime": true, + "title": "SAP HANA system overview", + "type": "link", + "url": "/d/sap-hana-system-overview" } ], "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [ ], + "title": "Resources", + "type": "row" + }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "CPU usage percentage of the SAP HANA instance", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "continuous-BlYlRd" }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, + "decimals": 1, + "max": 100, + "min": 0, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 0, - "y": 0 + "y": 1 }, "id": 2, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, core) (hanadb_cpu_busy_percent{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job, sid, host, core) (hanadb_cpu_busy_percent{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - core {{core}}" + "instant": false, + "legendFormat": "{{host}} - core {{core}}", + "refId": "CPU usage" } ], "title": "CPU usage", @@ -119,90 +108,57 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Disk utilization percentage of the SAP HANA instance", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "continuous-BlYlRd" }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 1, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, + "decimals": 1, + "max": 100, + "min": 0, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 12, - "y": 0 + "y": 1 }, "id": 3, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Disk usage" } ], "title": "Disk usage", @@ -210,99 +166,68 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Physical memory utilization percentage of the SAP HANA instance", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "continuous-BlYlRd" }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, + "decimals": 1, + "max": 100, + "min": 0, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 0, - "y": 6 + "y": 9 }, "id": 4, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_resident_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_resident_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - resident" + "instant": false, + "legendFormat": "{{host}} - resident", + "refId": "Physical memory usage - resident" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"}) / clamp_min(sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"} + hanadb_host_memory_swap_free_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"}), 1)", + "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / clamp_min(sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"} + hanadb_host_memory_swap_free_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}), 1)", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - swap" + "instant": false, + "legendFormat": "{{host}} - swap", + "refId": "Physical memory usage - swap" } ], "title": "Physical memory usage", @@ -310,190 +235,161 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Total used memory by schema in the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ + "min": 0, + "unit": "decmbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*(T|t)otal.*" + }, + "properties": [ { - "color": "green", - "value": null + "id": "color", + "value": { + "fixedColor": "light-orange", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 }, { - "color": "red", - "value": 80 + "id": "custom.lineStyle", + "value": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + } } ] - }, - "unit": "decmbytes" - }, - "overrides": [ ] + } + ] }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 12, - "y": 6 + "y": 9 }, "id": 5, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, database_name, schema_name) (hanadb_schema_used_memory_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job,sid,host) (\n sum by (job, sid, host, database_name, schema_name) (hanadb_schema_used_memory_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})\n)", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{database_name}} - {{schema_name}}" + "instant": false, + "legendFormat": "{{host}} - {{database_name}} - {{schema_name}}", + "refId": "Schema memory usage" } ], "title": "Schema memory usage", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 17 + }, + "id": 6, + "panels": [ ], + "title": "I/O", + "type": "row" + }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Network I/O throughput for the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, + "decimals": 1, + "noValue": "No traffic", "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 0, - "y": 12 + "y": 18 }, - "id": 6, + "id": 7, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, interface) (hanadb_network_receive_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job, sid, host, interface) (hanadb_network_receive_rate_kb_per_seconds{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{interface}} - receive" + "instant": false, + "legendFormat": "{{host}} - {{interface}} - receive", + "refId": "Network receive rate" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, interface) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job, sid, host, interface) (hanadb_network_transmission_rate_kb_per_seconds{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{interface}} - transmit" + "instant": false, + "legendFormat": "{{host}} - {{interface}} - transmit", + "refId": "Network transmit rate" } ], "title": "Network I/O throughput", @@ -501,182 +397,138 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Disk throughput for the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "fillOpacity": 1, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ + "unit": "KBs" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/time|used|busy|util/" + }, + "properties": [ + { + "id": "custom.axisSoftMax", + "value": 100 + }, { - "color": "green", - "value": null + "id": "custom.drawStyle", + "value": "points" }, { - "color": "red", - "value": 80 + "id": "unit", + "value": "percent" } ] - }, - "unit": "KBs" - }, - "overrides": [ ] + } + ] }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 12, - "y": 12 + "y": 18 }, - "id": 7, + "id": 8, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, disk) (hanadb_disk_io_throughput_kb_second{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job, sid, host, disk) (hanadb_disk_io_throughput_kb_second{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{disk}}" + "instant": false, + "legendFormat": "{{host}} - {{disk}}", + "refId": "Disk I/O throughput" } ], "title": "Disk I/O throughput", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 26 + }, + "id": 9, + "panels": [ ], + "title": "Performance", + "type": "row" + }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Number of connections grouped by type and status in the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "blue", - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] + "unit": "short" + } }, "gridPos": { - "h": 6, + "h": 8, "w": 8, "x": 0, - "y": 18 + "y": 27 }, - "id": 8, + "id": 10, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.2-cloud.1.f9fd074b", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, connection_type, connection_status)(hanadb_connections_total_count{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job, sid, host, connection_type, connection_status) (hanadb_connections_total_count{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{connection_type}} - {{connection_status}}" + "instant": false, + "legendFormat": "{{host}} - {{connection_type}} - {{connection_status}}", + "refId": "Connections" } ], "title": "Connections", @@ -684,91 +536,51 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Average elapsed time per execution by service and SQL type in the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "ms" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 8, "x": 8, - "y": 18 + "y": 27 }, - "id": 9, + "id": 11, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", - "sort": "none" + "sort": "desc" } }, - "pluginVersion": "9.5.0-cloud.5.a016665c", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "avg by (job, sid, host, service, sql_type) ( hanadb_sql_service_elap_per_exec_avg_ms{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "avg by (job,sid,host, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{service}} - {{sql_type}}" + "instant": false, + "legendFormat": "{{host}} - {{service}} - {{sql_type}}", + "refId": "Average query execution time" } ], "title": "Average query execution time", @@ -776,91 +588,51 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Average lock wait time per execution by service and SQL type in the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "ms" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 8, "x": 16, - "y": 18 + "y": 27 }, - "id": 10, + "id": 12, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.0-cloud.5.a016665c", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, service, sql_type) (hanadb_sql_service_lock_per_exec_ms{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job,sid,host, service, sql_type) (hanadb_sql_service_lock_per_exec_ms{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{service}} - {{sql_type}}" + "instant": false, + "legendFormat": "{{host}} - {{service}} - {{sql_type}}", + "refId": "Average lock wait execution time" } ], "title": "Average lock wait execution time", @@ -868,83 +640,55 @@ }, { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, - "y": 24 + "y": 35 }, - "id": 11, - "targets": [ ], + "id": 13, + "panels": [ ], "title": "Alerts", "type": "row" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Count of the SAP HANA instance’s current alerts", + "description": "Count of the SAP HANA instance's current alerts", "fieldConfig": { "defaults": { "color": { - "fixedColor": "yellow", "mode": "thresholds" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "green", - "value": 0 - }, - { - "color": "#EAB839", - "value": 1 - } - ] - } - }, - "overrides": [ ] + "unit": "short" + } }, "gridPos": { - "h": 6, + "h": 8, "w": 7, "x": 0, - "y": 25 + "y": 36 }, - "id": 12, + "id": 14, "options": { "colorMode": "value", "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, "textMode": "auto" }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job, sid, host) (hanadb_alerts_current_rating{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Alerts" } ], "title": "Alerts", @@ -952,67 +696,29 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Table of the recent SAP HANA current alerts in the SAP HANA instance", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "align": "center", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] - }, "gridPos": { - "h": 6, + "h": 8, "w": 17, "x": 7, - "y": 25 - }, - "id": 13, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true + "y": 36 }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "id": 15, + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"}", + "expr": "hanadb_alerts_current_rating{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}", "format": "table", - "intervalFactor": 2, - "legendFormat": "{{alert_details}} {{alert_useraction}}" + "instant": true, + "legendFormat": "{{host}}", + "refId": "Recent alerts" } ], "title": "Recent alerts", @@ -1091,107 +797,96 @@ }, { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, - "y": 31 + "y": 44 }, - "id": 14, - "targets": [ ], + "id": 16, + "panels": [ ], "title": "Outliers", "type": "row" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Top tables by the sum of memory size in the main, delta, and history parts for the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ + "min": 0, + "unit": "decmbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*(T|t)otal.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-orange", + "mode": "fixed" + } + }, { - "color": "green", - "value": null + "id": "custom.fillOpacity", + "value": 0 }, { - "color": "red", - "value": 80 + "id": "custom.lineStyle", + "value": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + } } ] - }, - "unit": "decmbytes" - }, - "overrides": [ ] + } + ] }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 0, - "y": 32 + "y": 45 }, - "id": 15, + "id": 17, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.0-cloud.5.a016665c", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, database_name, table_name, schema_name)(topk(5, hanadb_table_cs_top_mem_total_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"}))", + "expr": "sum by (job,sid,host, database_name, table_name, schema_name) (topk(5, hanadb_table_cs_top_mem_total_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{database_name}} - {{schema_name}} - {{table_name}}" + "instant": false, + "legendFormat": "{{host}} - {{database_name}} - {{schema_name}} - {{table_name}}", + "refId": "Top tables by memory" } ], "title": "Top tables by memory", @@ -1199,230 +894,123 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Top statements by time consumed over all executions for the SAP HANA instance", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "µs" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 12, "x": 12, - "y": 32 + "y": 45 }, - "id": 16, + "id": 18, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.0-cloud.5.a016665c", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, sql_hash) (hanadb_sql_top_time_consumers_mu{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job,sid,host, sql_hash) (hanadb_sql_top_time_consumers_mu{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - hash: {{sql_hash}}" + "instant": false, + "legendFormat": "{{host}} - hash: {{sql_hash}}", + "refId": "Top SQL queries by average time" } ], "title": "Top SQL queries by average time", "type": "timeseries" - }, - { - "datasource": { - "uid": "${loki_datasource}" - }, - "description": "Recent trace logs as collected from SAP HANA.", - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 38 - }, - "id": 17, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "pluginVersion": "9.5.0-cloud.5.a016665c", - "targets": [ - { - "datasource": { - "uid": "${loki_datasource}" - }, - "editorMode": "code", - "expr": "{filename=~\"/opt/hana/shared/.*/HDB.*/.*/trace/.*.trc\"} |=``", - "queryType": "range", - "refId": "A" - } - ], - "title": "Trace logs", - "type": "logs" } ], "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "schemaVersion": 39, "tags": [ "sap-hana-mixin" ], "templating": { "list": [ { - "current": { }, - "hide": 0, - "label": "Data Source", + "label": "Prometheus data source", "name": "prometheus_datasource", - "options": [ ], "query": "prometheus", - "refresh": 1, "regex": "", "type": "datasource" }, { - "current": { }, - "hide": 0, - "label": "Loki Datasource", - "name": "loki_datasource", - "options": [ ], - "query": "loki", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, + "includeAll": true, "label": "Job", - "multi": false, + "multi": true, "name": "job", - "options": [ ], - "query": "label_values(hanadb_cpu_busy_percent,job)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "query": "label_values(hanadb_cpu_busy_percent{job=\"integrations/sap-hana\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, + "includeAll": true, "label": "SAP HANA system", - "multi": false, + "multi": true, "name": "sid", - "options": [ ], - "query": "label_values(hanadb_cpu_busy_percent,sid)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "query": "label_values(hanadb_cpu_busy_percent{job=\"integrations/sap-hana\",job=~\"$job\"}, sid)", + "refresh": 2, + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, "label": "SAP HANA instance", - "multi": false, + "multi": true, "name": "host", - "options": [ ], - "query": "label_values(hanadb_cpu_busy_percent,host)", - "refresh": 1, + "query": "label_values(hanadb_cpu_busy_percent{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\"}, host)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "hide": 2, + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "datasource" } ] }, @@ -1430,33 +1018,7 @@ "from": "now-1h", "to": "now" }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, "timezone": "default", "title": "SAP HANA instance overview", - "uid": "sap-hana-instance-overview", - "version": 0 + "uid": "sap-hana-instance-overview" } \ No newline at end of file diff --git a/sap-hana-mixin/dashboards_out/sap-hana-logs.json b/sap-hana-mixin/dashboards_out/sap-hana-logs.json new file mode 100644 index 000000000..e9df78b67 --- /dev/null +++ b/sap-hana-mixin/dashboards_out/sap-hana-logs.json @@ -0,0 +1,326 @@ +{ + "annotations": { + "list": [ ] + }, + "graphTooltip": 1, + "links": [ + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "sap-hana-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + }, + { + "keepTime": true, + "title": "SAP HANA instance overview", + "type": "link", + "url": "/d/sap-hana-instance-overview" + }, + { + "keepTime": true, + "title": "SAP HANA logs", + "type": "link", + "url": "/d/sap-hana-logs" + }, + { + "keepTime": true, + "title": "SAP HANA system overview", + "type": "link", + "url": "/d/sap-hana-system-overview" + } + ], + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "description": "Logs volume grouped by \"level\" label.", + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "bars", + "fillOpacity": 50, + "stacking": { + "mode": "normal" + } + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)merg|(F|f)atal|(A|a)lert|(C|c)rit.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)(rr.*|RR.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(W|w)(arn.*|ARN.*|rn|RN)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(N|n)(otice|ote)|(I|i)(nf.*|NF.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "dbg.*|DBG.*|(D|d)(EBUG|ebug)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(T|t)(race|RACE)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "logs" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "text", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "maxDataPoints": 100, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "sum by (level) (count_over_time({job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",level=~\"$level\"}\n|~ \"$regex_search\"\n\n[$__auto]))\n", + "legendFormat": "{{ level }}" + } + ], + "title": "Logs volume", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "Value", + "renamePattern": "logs" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 2, + "options": { + "dedupStrategy": "exact", + "enableLogDetails": true, + "prettifyLogMessage": true, + "showTime": false, + "wrapLogMessage": false + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",level=~\"$level\"} \n|~ \"$regex_search\"\n\n\n" + } + ], + "title": "Logs", + "type": "logs" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "sap-hana-mixin" + ], + "templating": { + "list": [ + { + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values({job=\"integrations/sap-hana\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "SAP HANA system", + "multi": true, + "name": "sid", + "query": "label_values({job=\"integrations/sap-hana\",job=~\"$job\"}, sid)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Level", + "multi": true, + "name": "level", + "query": "label_values({job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\"}, level)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "label": "Regex search", + "name": "regex_search", + "options": [ + { + "selected": true, + "text": "", + "value": "" + } + ], + "query": "", + "type": "textbox" + }, + { + "hide": 2, + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "default", + "title": "SAP HANA logs", + "uid": "sap-hana-logs" + } \ No newline at end of file diff --git a/sap-hana-mixin/dashboards_out/sap-hana-system-overview.json b/sap-hana-mixin/dashboards_out/sap-hana-system-overview.json index 15f508365..1833927a7 100644 --- a/sap-hana-mixin/dashboards_out/sap-hana-system-overview.json +++ b/sap-hana-mixin/dashboards_out/sap-hana-system-overview.json @@ -1,78 +1,61 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, + "description": "SAP HANA system overview", + "graphTooltip": 1, "links": [ { - "asDropdown": false, - "icon": "external link", + "asDropdown": true, "includeVars": true, "keepTime": true, "tags": [ "sap-hana-mixin" ], - "targetBlank": false, - "title": "Other SAP HANA dashboards", - "type": "dashboards", - "url": "" + "title": "All dashboards", + "type": "dashboards" + }, + { + "keepTime": true, + "title": "SAP HANA instance overview", + "type": "link", + "url": "/d/sap-hana-instance-overview" + }, + { + "keepTime": true, + "title": "SAP HANA logs", + "type": "link", + "url": "/d/sap-hana-logs" + }, + { + "keepTime": true, + "title": "SAP HANA system overview", + "type": "link", + "url": "/d/sap-hana-system-overview" } ], "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [ ], + "title": "Replication", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "State of the replicas in the SAP HANA system", "fieldConfig": { "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "0": { - "color": "green", - "index": 0, - "text": "ACTIVE" - }, - "1": { - "color": "yellow", - "index": 1, - "text": "INITIALIZING" - }, - "2": { - "color": "yellow", - "index": 2, - "text": "SYNCING" - }, - "3": { - "color": "red", - "index": 3, - "text": "UNKNOWN" - }, - "4": { - "color": "red", - "index": 4, - "text": "ERROR" - }, - "99": { - "color": "red", - "index": 5, - "text": "UNMAPPED" - } - }, - "type": "value" - } - ], "thresholds": { "mode": "absolute", "steps": [ @@ -95,39 +78,45 @@ ] } }, - "overrides": [ ] + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "Replica status" + }, + "properties": [ + { + "id": "unit", + "value": "short" + } + ] + } + ] }, "gridPos": { "h": 6, "w": 9, "x": 0, - "y": 0 + "y": 1 }, "id": 2, "options": { "colorMode": "value", "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, "textMode": "auto" }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "hanadb_sr_replication{job=~\"$job\", sid=~\"$sid\"}", + "expr": "hanadb_sr_replication{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{secondary_site_name}}" + "instant": false, + "legendFormat": "{{secondary_site_name}}", + "refId": "Replica status" } ], "title": "Replica status", @@ -135,184 +124,131 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Average system replication log shipping delay in the SAP HANA system ", + "description": "Average system replication log shipping delay in the SAP HANA system", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, - "mappings": [ ], "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 1 - } - ] + "steps": [ ] }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 15, "x": 9, - "y": 0 + "y": 1 }, "id": 3, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "avg by (job, sid, secondary_site_name) (hanadb_sr_ship_delay{job=~\"$job\", sid=~\"$sid\"})", + "expr": "avg by (job,sid,host, secondary_site_name) (hanadb_sr_ship_delay{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{secondary_site_name}}" + "instant": false, + "legendFormat": "{{secondary_site_name}}", + "refId": "Average replication ship delay" } ], "title": "Average replication ship delay", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 7 + }, + "id": 4, + "panels": [ ], + "title": "Resources", + "type": "row" + }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "CPU usage percentage of the SAP HANA system", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "continuous-BlYlRd" }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, + "fillOpacity": 30, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, + "decimals": 1, + "max": 100, + "min": 0, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 6 + "y": 8 }, - "id": 4, + "id": 5, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host, core) (hanadb_cpu_busy_percent{job=~\"$job\", sid=~\"$sid\"})", + "expr": "sum by (job,sid,host, core) (hanadb_cpu_busy_percent{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - core {{core}}" + "instant": false, + "legendFormat": "{{host}} - core {{core}}", + "refId": "CPU usage" } ], "title": "CPU usage", @@ -320,90 +256,54 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Disk utilization percentage of the SAP HANA system", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 6 + "y": 8 }, - "id": 5, + "id": 6, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{job=~\"$job\", sid=~\"$sid\"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job=~\"$job\", sid=~\"$sid\"})", + "expr": "100 * sum by (job,sid,host) (hanadb_disk_total_used_size_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job,sid,host) (hanadb_disk_total_size_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Disk usage" } ], "title": "Disk usage", @@ -411,99 +311,71 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Physical memory utilization percentage of the SAP HANA system", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "continuous-BlYlRd" }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, + "fillOpacity": 30, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, + "decimals": 1, + "max": 100, + "min": 0, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 12 + "y": 14 }, - "id": 6, + "id": 7, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_resident_mb{job=~\"$job\", sid=~\"$sid\"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=~\"$job\", sid=~\"$sid\"})", + "expr": "100 * sum by (job,sid,host) (hanadb_host_memory_resident_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job,sid,host) (hanadb_host_memory_physical_total_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - resident" + "instant": false, + "legendFormat": "{{host}} - resident", + "refId": "Physical memory usage - resident" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~\"$job\", sid=~\"$sid\"}) / clamp_min(sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~\"$job\", sid=~\"$sid\"} + hanadb_host_memory_swap_free_mb{job=~\"$job\", sid=~\"$sid\"}), 1)", + "expr": "100 * sum by (job,sid,host) (hanadb_host_memory_swap_used_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / clamp_min(sum by (job,sid,host) (hanadb_host_memory_swap_used_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"} + hanadb_host_memory_swap_free_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}), 1)", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - swap" + "instant": false, + "legendFormat": "{{host}} - swap", + "refId": "Physical memory usage - swap" } ], "title": "Physical memory usage", @@ -511,190 +383,138 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Total amount of used memory by processes in the SAP HANA system", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "continuous-BlYlRd" }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, + "fillOpacity": 30, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, + "decimals": 1, + "max": 100, + "min": 0, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 12 + "y": 14 }, - "id": 7, + "id": 8, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_used_total_mb{job=~\"$job\", sid=~\"$sid\"}) / sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{job=~\"$job\", sid=~\"$sid\"})", + "expr": "100 * sum by (job,sid,host) (hanadb_host_memory_used_total_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job,sid,host) (hanadb_host_memory_alloc_limit_mb{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "SAP HANA memory usage" } ], "title": "SAP HANA memory usage", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 20 + }, + "id": 9, + "panels": [ ], + "title": "I/O", + "type": "row" + }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Network I/O throughput in the SAP HANA system", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" + }, + "decimals": 1, + "noValue": "No traffic", "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 18 + "y": 21 }, - "id": 8, + "id": 10, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_network_receive_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\"})", + "expr": "sum by (job,sid,host) (hanadb_network_receive_rate_kb_per_seconds{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - receive" + "instant": false, + "legendFormat": "{{host}} - receive", + "refId": "Network receive rate" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\"})", + "expr": "sum by (job,sid,host, interface) (hanadb_network_transmission_rate_kb_per_seconds{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - transmit" + "instant": false, + "legendFormat": "{{host}} - transmit", + "refId": "Network transmit rate" } ], "title": "Network I/O throughput", @@ -702,180 +522,138 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Disk throughput for the SAP HANA system", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "fillOpacity": 1, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ + "unit": "KBs" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/time|used|busy|util/" + }, + "properties": [ { - "color": "green", - "value": null + "id": "custom.axisSoftMax", + "value": 100 }, { - "color": "red", - "value": 80 + "id": "custom.drawStyle", + "value": "points" + }, + { + "id": "unit", + "value": "percent" } ] - }, - "unit": "KBs" - }, - "overrides": [ ] + } + ] }, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 18 + "y": 21 }, - "id": 9, + "id": 11, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_disk_io_throughput_kb_second{job=~\"$job\", sid=~\"$sid\"})", + "expr": "sum by (job,sid,host) (hanadb_disk_io_throughput_kb_second{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Disk I/O throughput" } ], "title": "Disk I/O throughput", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 27 + }, + "id": 12, + "panels": [ ], + "title": "Performance", + "type": "row" + }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Average elapsed time per execution across the SAP HANA system", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "ms" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 24 + "y": 28 }, - "id": 10, + "id": 13, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "avg by (job, sid, host, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{job=~\"$job\", sid=~\"$sid\"})", + "expr": "avg by (job,sid,host, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - service: {{service}} - type: {{sql_type}}" + "instant": false, + "legendFormat": "{{host}} - service: {{service}} - type: {{sql_type}}", + "refId": "Average query execution time" } ], "title": "Average query execution time", @@ -883,7 +661,8 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of connections in active states across the SAP HANA system", "fieldConfig": { @@ -892,53 +671,33 @@ "fixedColor": "blue", "mode": "fixed" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] + "unit": "short" + } }, "gridPos": { "h": 6, "w": 6, "x": 12, - "y": 24 + "y": 28 }, - "id": 11, + "id": 14, "options": { "colorMode": "value", "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, "textMode": "auto" }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_connections_total_count{job=~\"$job\", sid=~\"$sid\", connection_status=~\"RUNNING|QUEUING\"})", + "expr": "sum by (job,sid,host) (hanadb_connections_total_count{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\", connection_status=~\"RUNNING|QUEUING\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Active connections" } ], "title": "Active connections", @@ -946,7 +705,8 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of connections in the idle state across the SAP HANA system", "fieldConfig": { @@ -955,53 +715,33 @@ "fixedColor": "blue", "mode": "fixed" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] + "unit": "short" + } }, "gridPos": { "h": 6, "w": 6, "x": 18, - "y": 24 + "y": 28 }, - "id": 12, + "id": 15, "options": { "colorMode": "value", "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, "textMode": "auto" }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_connections_total_count{job=~\"$job\", sid=~\"$sid\", connection_status=~\"IDLE\"})", + "expr": "sum by (job,sid,host) (hanadb_connections_total_count{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\", connection_status=~\"IDLE\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Idle connections" } ], "title": "Idle connections", @@ -1009,82 +749,55 @@ }, { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, - "y": 30 + "y": 34 }, - "id": 13, - "targets": [ ], + "id": 16, + "panels": [ ], "title": "Alerts", "type": "row" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Count of the SAP HANA current alerts in the SAP HANA system", "fieldConfig": { "defaults": { "color": { - "fixedColor": "yellow", "mode": "thresholds" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "green", - "value": 0 - }, - { - "color": "#EAB839", - "value": 1 - } - ] - } - }, - "overrides": [ ] + "unit": "short" + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 0, - "y": 31 + "y": 35 }, - "id": 14, + "id": 17, "options": { "colorMode": "value", "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, "textMode": "auto" }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\"})", + "expr": "sum by (job,sid,host) (hanadb_alerts_current_rating{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Alerts" } ], "title": "Alerts", @@ -1092,69 +805,29 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Table of the recent SAP HANA current alerts in the SAP HANA system", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "align": "center", - "cellOptions": { - "type": "auto" - }, - "filterable": false, - "inspect": false - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] - }, "gridPos": { - "h": 6, + "h": 8, "w": 18, "x": 6, - "y": 31 - }, - "id": 15, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "frameIndex": 4, - "showHeader": true + "y": 35 }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "id": 18, + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\"}", + "expr": "hanadb_alerts_current_rating{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}", "format": "table", - "intervalFactor": 2, - "legendFormat": "" + "instant": true, + "legendFormat": "{{host}}", + "refId": "Recent alerts" } ], "title": "Recent alerts", @@ -1166,7 +839,6 @@ "Time": false, "Value": true, "__name__": true, - "alert_details": false, "alert_timestamp": true, "database_name": true, "host": true, @@ -1236,68 +908,71 @@ } ], "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "schemaVersion": 39, "tags": [ "sap-hana-mixin" ], "templating": { "list": [ { - "current": { }, - "hide": 0, - "label": "Data Source", + "label": "Prometheus data source", "name": "prometheus_datasource", - "options": [ ], "query": "prometheus", - "refresh": 1, "regex": "", "type": "datasource" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, + "includeAll": true, "label": "Job", - "multi": false, + "multi": true, "name": "job", - "options": [ ], - "query": "label_values(hanadb_cpu_busy_percent,job)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "query": "label_values(hanadb_cpu_busy_percent{job=\"integrations/sap-hana\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, + "includeAll": true, "label": "SAP HANA system", - "multi": false, + "multi": true, "name": "sid", - "options": [ ], - "query": "label_values(hanadb_cpu_busy_percent,sid)", - "refresh": 1, + "query": "label_values(hanadb_cpu_busy_percent{job=\"integrations/sap-hana\",job=~\"$job\"}, sid)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "SAP HANA instance", + "multi": true, + "name": "host", + "query": "label_values(hanadb_cpu_busy_percent{job=\"integrations/sap-hana\",job=~\"$job\",sid=~\"$sid\"}, host)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "hide": 2, + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "datasource" } ] }, @@ -1305,33 +980,7 @@ "from": "now-1h", "to": "now" }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, "timezone": "default", "title": "SAP HANA system overview", - "uid": "sap-hana-system-overview", - "version": 0 + "uid": "sap-hana-system-overview" } \ No newline at end of file diff --git a/sap-hana-mixin/g.libsonnet b/sap-hana-mixin/g.libsonnet new file mode 100644 index 000000000..e6a2060ee --- /dev/null +++ b/sap-hana-mixin/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/main.libsonnet' diff --git a/sap-hana-mixin/jsonnetfile.json b/sap-hana-mixin/jsonnetfile.json index 65cebf84b..6354d0e12 100644 --- a/sap-hana-mixin/jsonnetfile.json +++ b/sap-hana-mixin/jsonnetfile.json @@ -1,15 +1,42 @@ { - "version": 1, - "dependencies": [ - { - "source": { - "git": { - "remote": "https://github.com/grafana/grafonnet-lib.git", - "subdir": "grafonnet" - } - }, - "version": "master" - } - ], - "legacyImports": true + "version": 1, + "dependencies": [ + { + "source": { + "git": { + "remote": "https://github.com/grafana/grafonnet-lib.git", + "subdir": "grafonnet" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "common-lib" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "grafana-cloud-integration-utils" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "logs-lib" + } + }, + "version": "master" + } + ], + "legacyImports": true } diff --git a/sap-hana-mixin/links.libsonnet b/sap-hana-mixin/links.libsonnet new file mode 100644 index 000000000..846da4fcd --- /dev/null +++ b/sap-hana-mixin/links.libsonnet @@ -0,0 +1,25 @@ +local g = import './g.libsonnet'; + +{ + local link = g.dashboard.link, + new(this): { + sapHanaOverview: + link.link.new('SAP HANA system overview', '/d/' + this.grafana.dashboards['sap-hana-system-overview.json'].uid) + + link.link.options.withKeepTime(true), + + sapHanaInstance: + link.link.new('SAP HANA instance overview', '/d/' + this.grafana.dashboards['sap-hana-instance-overview.json'].uid) + + link.link.options.withKeepTime(true), + + otherDashboards: + link.dashboards.new('All dashboards', this.config.dashboardTags) + + link.dashboards.options.withIncludeVars(true) + + link.dashboards.options.withKeepTime(true) + + link.dashboards.options.withAsDropdown(true), + + } + if this.config.enableLokiLogs then { + sapHanaLogs: + link.link.new('SAP HANA logs', '/d/' + this.grafana.dashboards['sap-hana-logs.json'].uid) + + link.link.options.withKeepTime(true), + } else {}, +} diff --git a/sap-hana-mixin/main.libsonnet b/sap-hana-mixin/main.libsonnet new file mode 100644 index 000000000..91dd61ab4 --- /dev/null +++ b/sap-hana-mixin/main.libsonnet @@ -0,0 +1,47 @@ +local alerts = import './alerts.libsonnet'; +local config = import './config.libsonnet'; +local dashboards = import './dashboards.libsonnet'; +local links = import './links.libsonnet'; +local panels = import './panels.libsonnet'; +local rows = import './rows.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + withConfigMixin(config): { + config+: config, + }, + + new(): { + local this = self, + config: config, + + signals: + { + [sig]: commonlib.signals.unmarshallJsonMulti( + this.config.signals[sig], + type=this.config.metricsSource + ) + for sig in std.objectFields(this.config.signals) + }, + + grafana: { + variables: commonlib.variables.new( + filteringSelector=this.config.filteringSelector, + groupLabels=this.config.groupLabels, + instanceLabels=this.config.instanceLabels, + varMetric='hanadb_cpu_busy_percent', + enableLokiLogs=this.config.enableLokiLogs, + ), + annotations: {}, + links: links.new(this), + panels: panels.new(this), + dashboards: dashboards.new(this), + rows: rows.new(this), + }, + + prometheus: { + alerts: alerts.new(this), + recordingRules: {}, + }, + }, +} diff --git a/sap-hana-mixin/mixin.libsonnet b/sap-hana-mixin/mixin.libsonnet index 4d987cf31..78f804ada 100644 --- a/sap-hana-mixin/mixin.libsonnet +++ b/sap-hana-mixin/mixin.libsonnet @@ -1,3 +1,32 @@ -(import 'dashboards/dashboards.libsonnet') + -(import 'alerts/alerts.libsonnet') + -(import 'config.libsonnet') +local config = import './config.libsonnet'; +local lib = import './main.libsonnet'; +local util = import 'grafana-cloud-integration-utils/util.libsonnet'; + + +local saphana = + lib.new() + + lib.withConfigMixin({ + filteringSelector: config.filteringSelector, + uid: config.uid, + enableLokiLogs: config.enableLokiLogs, + }); + +local optional_labels = { + sid+: { + label: 'SAP HANA system', + }, + host+: { + label: 'SAP HANA instance', + }, +}; + +{ + grafanaDashboards+:: { + [fname]: + local dashboard = saphana.grafana.dashboards[fname]; + dashboard + util.patch_variables(dashboard, optional_labels) + for fname in std.objectFields(saphana.grafana.dashboards) + }, + prometheusAlerts+:: saphana.prometheus.alerts, + prometheusRules+:: saphana.prometheus.recordingRules, +} diff --git a/sap-hana-mixin/panels.libsonnet b/sap-hana-mixin/panels.libsonnet new file mode 100644 index 000000000..ab9d25a4a --- /dev/null +++ b/sap-hana-mixin/panels.libsonnet @@ -0,0 +1,395 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + new(this):: + { + local signals = this.signals, + + // System overview panels + systemReplicaStatusPanel: + g.panel.stat.new('Replica status') + + g.panel.stat.queryOptions.withTargets([ + signals.system.replicaStatus.asTarget(), + ]) + + signals.system.replicaStatus.asOverride() + + g.panel.stat.panelOptions.withDescription('State of the replicas in the SAP HANA system') + + g.panel.stat.options.withColorMode('value') + + g.panel.stat.options.withGraphMode('none') + + g.panel.stat.options.withTextMode('auto') + + g.panel.stat.standardOptions.thresholds.withMode('absolute') + + g.panel.stat.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'green', value: 0 }, + { color: 'yellow', value: 1 }, + { color: 'red', value: 3 }, + ]), + + systemReplicationShipDelayPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Average replication ship delay', + targets=[signals.system.replicationShipDelay.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Average system replication log shipping delay in the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withThresholdsStyle({ mode: 'line' }), + + systemCpuUsagePanel: + commonlib.panels.cpu.timeSeries.utilization.new( + 'CPU usage', + targets=[signals.system.cpuUsage.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('CPU usage percentage of the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.fieldConfig.defaults.custom.withThresholdsStyle({ mode: 'line' }), + + systemDiskUsagePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Disk usage', + targets=[signals.system.diskUsage.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Disk utilization percentage of the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.fieldConfig.defaults.custom.withThresholdsStyle({ mode: 'line' }), + + systemPhysicalMemoryUsagePanel: + commonlib.panels.memory.timeSeries.usagePercent.new( + 'Physical memory usage', + targets=[ + signals.system.physicalMemoryUsageResident.asTarget(), + signals.system.physicalMemoryUsageSwap.asTarget(), + ] + ) + + g.panel.timeSeries.panelOptions.withDescription('Physical memory utilization percentage of the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.fieldConfig.defaults.custom.withThresholdsStyle({ mode: 'line' }), + + systemHanaMemoryUsagePanel: + commonlib.panels.memory.timeSeries.usagePercent.new( + 'SAP HANA memory usage', + targets=[signals.system.hanaMemoryUsage.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Total amount of used memory by processes in the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.fieldConfig.defaults.custom.withThresholdsStyle({ mode: 'line' }), + + systemNetworkIOThroughputPanel: + commonlib.panels.network.timeSeries.traffic.new( + 'Network I/O throughput', + targets=[ + signals.system.networkReceiveRate.asTarget(), + signals.system.networkTransmitRate.asTarget(), + ] + ) + + g.panel.timeSeries.panelOptions.withDescription('Network I/O throughput in the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('KBs'), + + systemDiskIOThroughputPanel: + commonlib.panels.disk.timeSeries.ioBytesPerSec.new( + 'Disk I/O throughput', + targets=[signals.system.diskIOThroughput.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Disk throughput for the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('KBs'), + + systemAvgQueryExecutionTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Average query execution time', + targets=[signals.system.avgQueryExecutionTime.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Average elapsed time per execution across the SAP HANA system') + + g.panel.timeSeries.standardOptions.withUnit('ms'), + + systemActiveConnectionsPanel: + g.panel.stat.new('Active connections') + + g.panel.stat.queryOptions.withTargets([ + signals.system.activeConnections.asTarget(), + ]) + + g.panel.stat.panelOptions.withDescription('Number of connections in active states across the SAP HANA system') + + g.panel.stat.standardOptions.withUnit('short') + + g.panel.stat.standardOptions.color.withMode('fixed') + + g.panel.stat.standardOptions.color.withFixedColor('blue') + + g.panel.stat.options.withColorMode('value') + + g.panel.stat.options.withGraphMode('none') + + g.panel.stat.options.withTextMode('auto'), + + systemIdleConnectionsPanel: + g.panel.stat.new('Idle connections') + + g.panel.stat.queryOptions.withTargets([ + signals.system.idleConnections.asTarget(), + ]) + + g.panel.stat.panelOptions.withDescription('Number of connections in the idle state across the SAP HANA system') + + g.panel.stat.standardOptions.withUnit('short') + + g.panel.stat.standardOptions.color.withMode('fixed') + + g.panel.stat.standardOptions.color.withFixedColor('blue') + + g.panel.stat.options.withColorMode('value') + + g.panel.stat.options.withGraphMode('none') + + g.panel.stat.options.withTextMode('auto'), + + systemAlertsPanel: + g.panel.stat.new('Alerts') + + g.panel.stat.queryOptions.withTargets([ + signals.system.alertsCount.asTarget(), + ]) + + g.panel.stat.panelOptions.withDescription('Count of the SAP HANA current alerts in the SAP HANA system') + + g.panel.stat.standardOptions.withUnit('short') + + g.panel.stat.standardOptions.color.withMode('thresholds') + + g.panel.stat.options.withColorMode('value') + + g.panel.stat.options.withGraphMode('none') + + g.panel.stat.options.withTextMode('auto'), + + systemRecentAlertsPanel: + g.panel.table.new('Recent alerts') + + g.panel.table.queryOptions.withDatasource(type='prometheus', uid='${' + this.grafana.variables.datasources.prometheus.name + '}') + + g.panel.table.queryOptions.withTargets([ + signals.system.recentAlerts.asTableTarget(), + ]) + + g.panel.table.panelOptions.withDescription('Table of the recent SAP HANA current alerts in the SAP HANA system') + + g.panel.table.queryOptions.withTransformations([ + g.panel.table.transformation.withId('organize') + + g.panel.table.transformation.withOptions({ + excludeByName: { + Time: false, + Value: true, + __name__: true, + alert_timestamp: true, + database_name: true, + host: true, + insnr: true, + instance: true, + job: true, + port: true, + sid: true, + }, + indexByName: { + Time: 2, + Value: 12, + __name__: 4, + alert_details: 0, + alert_timestamp: 3, + alert_useraction: 1, + database_name: 5, + host: 6, + insnr: 7, + instance: 8, + job: 9, + port: 10, + sid: 11, + }, + renameByName: { + alert_details: 'Details', + alert_timestamp: '', + alert_useraction: 'Action', + database_name: '', + }, + }), + g.panel.table.transformation.withId('groupBy') + + g.panel.table.transformation.withOptions({ + fields: { + Action: { + aggregations: [], + operation: 'groupby', + }, + Details: { + aggregations: [], + operation: 'groupby', + }, + Time: { + aggregations: ['lastNotNull'], + operation: 'aggregate', + }, + }, + }), + g.panel.table.transformation.withId('organize') + + g.panel.table.transformation.withOptions({ + excludeByName: {}, + indexByName: {}, + renameByName: { + Action: '', + 'Time (lastNotNull)': 'Time (last fired)', + }, + }), + ]), + + // Instance overview panels + instanceCpuUsagePanel: + commonlib.panels.cpu.timeSeries.utilization.new( + 'CPU usage', + targets=[signals.instance.cpuUsageByCore.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('CPU usage percentage of the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('percent'), + + instanceDiskUsagePanel: + commonlib.panels.disk.timeSeries.usagePercent.new( + 'Disk usage', + targets=[signals.instance.diskUsage.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Disk utilization percentage of the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('percent'), + + instancePhysicalMemoryUsagePanel: + commonlib.panels.memory.timeSeries.usagePercent.new( + 'Physical memory usage', + targets=[ + signals.instance.physicalMemoryUsageResident.asTarget(), + signals.instance.physicalMemoryUsageSwap.asTarget(), + ] + ) + + g.panel.timeSeries.panelOptions.withDescription('Physical memory utilization percentage of the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('percent'), + + instanceSchemaMemoryUsagePanel: + commonlib.panels.memory.timeSeries.usageBytes.new( + 'Schema memory usage', + targets=[signals.instance.schemaMemoryUsage.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Total used memory by schema in the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('decmbytes'), + + instanceNetworkIOThroughputPanel: + commonlib.panels.network.timeSeries.traffic.new( + 'Network I/O throughput', + targets=[ + signals.instance.networkReceiveByInterface.asTarget(), + signals.instance.networkTransmitByInterface.asTarget(), + ] + ) + + g.panel.timeSeries.panelOptions.withDescription('Network I/O throughput for the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('KBs'), + + instanceDiskIOThroughputPanel: + commonlib.panels.disk.timeSeries.ioBytesPerSec.new( + 'Disk I/O throughput', + targets=[signals.instance.diskIOByDisk.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Disk throughput for the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('KBs'), + + instanceConnectionsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Connections', + targets=[signals.instance.connectionsByStatus.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Number of connections grouped by type and status in the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('short'), + + instanceAvgQueryExecutionTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Average query execution time', + targets=[signals.performance.avgQueryExecutionTime.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Average elapsed time per execution by service and SQL type in the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('ms'), + + instanceAvgLockWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Average lock wait execution time', + targets=[signals.performance.avgLockWaitTime.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Average lock wait time per execution by service and SQL type in the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('ms'), + + instanceAlertsPanel: + g.panel.stat.new('Alerts') + + g.panel.stat.queryOptions.withTargets([ + signals.instance.alertsCount.asTarget(), + ]) + + g.panel.stat.panelOptions.withDescription("Count of the SAP HANA instance's current alerts") + + g.panel.stat.standardOptions.withUnit('short') + + g.panel.stat.standardOptions.color.withMode('thresholds') + + g.panel.stat.options.withColorMode('value') + + g.panel.stat.options.withGraphMode('none') + + g.panel.stat.options.withTextMode('auto'), + + instanceRecentAlertsPanel: + g.panel.table.new('Recent alerts') + + g.panel.table.queryOptions.withDatasource(type='prometheus', uid='${' + this.grafana.variables.datasources.prometheus.name + '}') + + g.panel.table.queryOptions.withTargets([ + signals.instance.recentAlerts.asTableTarget(), + ]) + + g.panel.table.panelOptions.withDescription('Table of the recent SAP HANA current alerts in the SAP HANA instance') + + g.panel.table.queryOptions.withTransformations([ + g.panel.table.transformation.withId('organize') + + g.panel.table.transformation.withOptions({ + excludeByName: { + Value: true, + __name__: true, + alert_timestamp: true, + database_name: true, + host: true, + insnr: true, + instance: true, + job: true, + port: true, + sid: true, + }, + indexByName: { + Time: 2, + Value: 12, + __name__: 3, + alert_details: 0, + alert_timestamp: 4, + alert_useraction: 1, + database_name: 5, + host: 6, + insnr: 7, + instance: 8, + job: 9, + port: 10, + sid: 11, + }, + renameByName: { + Time: '', + alert_details: 'Details', + alert_useraction: 'Action', + port: '', + }, + }), + g.panel.table.transformation.withId('groupBy') + + g.panel.table.transformation.withOptions({ + fields: { + Action: { + aggregations: [], + operation: 'groupby', + }, + Details: { + aggregations: [], + operation: 'groupby', + }, + Time: { + aggregations: ['lastNotNull'], + operation: 'aggregate', + }, + }, + }), + g.panel.table.transformation.withId('organize') + + g.panel.table.transformation.withOptions({ + excludeByName: {}, + indexByName: {}, + renameByName: { + 'Time (lastNotNull)': 'Time (last fired)', + }, + }), + ]), + + instanceTopTablesByMemoryPanel: + commonlib.panels.memory.timeSeries.usageBytes.new( + 'Top tables by memory', + targets=[signals.performance.topTablesByMemory.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Top tables by the sum of memory size in the main, delta, and history parts for the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('decmbytes'), + + instanceTopSQLByTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top SQL queries by average time', + targets=[signals.performance.topSQLByTime.asTarget()] + ) + + g.panel.timeSeries.panelOptions.withDescription('Top statements by time consumed over all executions for the SAP HANA instance') + + g.panel.timeSeries.standardOptions.withUnit('µs'), + + }, +} diff --git a/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml b/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml index 7fb6c2218..6415aeab9 100644 --- a/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml +++ b/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml @@ -3,64 +3,64 @@ groups: rules: - alert: SapHanaHighCpuUtilization annotations: - description: The CPU usage is at {{$labels.value}}% on {{$labels.core}} on {{$labels.host}} which is above the threshold of 80%. + description: The CPU usage is at {{ printf "%.2f" $value }}% on {{$labels.core}} on {{$labels.host}} which is above the threshold of 80%. summary: CPU utilization is high. expr: | - sum without (database_name) (hanadb_cpu_busy_percent) > 80 + sum without (database_name) (hanadb_cpu_busy_percent{job="integrations/sap-hana"}) > 80 for: 5m labels: severity: critical - alert: SapHanaHighPhysicalMemoryUsage annotations: - description: The physical memory usage is at {{$labels.value}}% on {{$labels.host}} which is above the threshold of 80%. + description: The physical memory usage is at {{ printf "%.2f" $value }}% on {{$labels.host}} which is above the threshold of 80%. summary: Current physical memory usage of the host is approaching capacity. expr: | - 100 * sum without (database_name)(hanadb_host_memory_resident_mb) / sum without (database_name) (hanadb_host_memory_physical_total_mb) > 80 + 100 * sum without (database_name)(hanadb_host_memory_resident_mb{job="integrations/sap-hana"}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{job="integrations/sap-hana"}) > 80 for: 5m labels: severity: critical - alert: SapHanaMemAllocLimitBelowRecommendation annotations: - description: The memory allocation limit is set at {{$labels.value}}% on {{$labels.host}} which is below the recommended value of 90%. + description: The memory allocation limit is set at {{ printf "%.2f" $value }}% on {{$labels.host}} which is below the recommended value of 90%. summary: Memory allocation limit set below recommended limit. expr: | - 100 * sum without (database_name) (hanadb_host_memory_alloc_limit_mb) / sum without (database_name) (hanadb_host_memory_physical_total_mb) < 90 + 100 * sum without (database_name) (hanadb_host_memory_alloc_limit_mb{job="integrations/sap-hana"}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{job="integrations/sap-hana"}) < 90 for: 5m labels: severity: warning - alert: SapHanaHighMemoryUsage annotations: - description: The memory usage is at {{$labels.value}}% on {{$labels.host}} which is above the threshold of 80%. + description: The memory usage is at {{ printf "%.2f" $value }}% on {{$labels.host}} which is above the threshold of 80%. summary: Current SAP HANA memory usage is approaching capacity. expr: | - 100 * sum without (database_name) (hanadb_host_memory_used_total_mb) / sum without (database_name) (hanadb_host_memory_alloc_limit_mb) > 80 + 100 * sum without (database_name) (hanadb_host_memory_used_total_mb{job="integrations/sap-hana"}) / sum without (database_name) (hanadb_host_memory_alloc_limit_mb{job="integrations/sap-hana"}) > 80 for: 5m labels: severity: critical - alert: SapHanaHighDiskUtilization annotations: - description: The disk usage is at {{$labels.value}}% on {{$labels.host}} which is above the threshold of 80%. + description: The disk usage is at {{ printf "%.2f" $value }}% on {{$labels.host}} which is above the threshold of job="integrations/sap-hana"%. summary: SAP HANA disk is approaching capacity. expr: | - 100 * sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_used_size_mb) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb) > 80 + 100 * sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_used_size_mb{job="integrations/sap-hana"}) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb{job="integrations/sap-hana"}) > 80 for: 5m labels: severity: critical - alert: SapHanaHighSqlExecutionTime annotations: - description: The average SQL execution time is at {{$labels.value}}s on {{$labels.host}} which is above the threshold of 1s. + description: The average SQL execution time is at {{ printf "%.2f" $value }}s on {{$labels.host}} which is above the threshold of 1s. summary: SAP HANA SQL average execution time is high. expr: | - avg without (database_name, port, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms) / 1000 > 1 + avg without (database_name, port, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{job="integrations/sap-hana"}) / 1000 > 1 for: 5m labels: severity: critical - alert: SapHanaHighReplicationShippingTime annotations: - description: The average system replication log shipping delay is at {{$labels.value}}s from primary site {{$labels.site_name}} to replica site {{$labels.secondary_site_name}} which is above the threshold of 1s. + description: The average system replication log shipping delay is at {{ printf "%.2f" $value }}s from primary site {{$labels.site_name}} to replica site {{$labels.secondary_site_name}} which is above the threshold of 1s. summary: SAP HANA system replication log shipping delay is high. expr: | - avg without (database_name, port, secondary_port, replication_mode) (hanadb_sr_ship_delay) > 1 + avg without (database_name, port, secondary_port, replication_mode) (hanadb_sr_ship_delay{job="integrations/sap-hana"}) > 1 for: 5m labels: severity: critical @@ -69,7 +69,7 @@ groups: description: The replication status of replica {{$labels.secondary_site_name}} is ERROR summary: SAP HANA system replication status signifies an error. expr: | - hanadb_sr_replication == 4 + hanadb_sr_replication{job="integrations/sap-hana"} == 4 for: 5m labels: severity: critical diff --git a/sap-hana-mixin/rows.libsonnet b/sap-hana-mixin/rows.libsonnet new file mode 100644 index 000000000..a89cd457c --- /dev/null +++ b/sap-hana-mixin/rows.libsonnet @@ -0,0 +1,85 @@ +local g = import './g.libsonnet'; + +{ + new(this):: { + local panels = this.grafana.panels, + + // System overview dashboard rows + systemReplicationRow: + g.panel.row.new('Replication') + + g.panel.row.withPanels([ + panels.systemReplicaStatusPanel { gridPos: { h: 6, w: 9, x: 0, y: 0 } }, + panels.systemReplicationShipDelayPanel { gridPos: { h: 6, w: 15, x: 9, y: 0 } }, + ]), + + systemResourcesRow: + g.panel.row.new('Resources') + + g.panel.row.withPanels([ + panels.systemCpuUsagePanel { gridPos: { h: 6, w: 12, x: 0, y: 1 } }, + panels.systemDiskUsagePanel { gridPos: { h: 6, w: 12, x: 12, y: 1 } }, + panels.systemPhysicalMemoryUsagePanel { gridPos: { h: 6, w: 12, x: 0, y: 7 } }, + panels.systemHanaMemoryUsagePanel { gridPos: { h: 6, w: 12, x: 12, y: 7 } }, + ]), + + systemIORow: + g.panel.row.new('I/O') + + g.panel.row.withPanels([ + panels.systemNetworkIOThroughputPanel { gridPos: { h: 6, w: 12, x: 0, y: 13 } }, + panels.systemDiskIOThroughputPanel { gridPos: { h: 6, w: 12, x: 12, y: 13 } }, + ]), + + systemPerformanceRow: + g.panel.row.new('Performance') + + g.panel.row.withPanels([ + panels.systemAvgQueryExecutionTimePanel { gridPos: { h: 6, w: 12, x: 0, y: 19 } }, + panels.systemActiveConnectionsPanel { gridPos: { h: 6, w: 6, x: 12, y: 19 } }, + panels.systemIdleConnectionsPanel { gridPos: { h: 6, w: 6, x: 18, y: 19 } }, + ]), + + systemAlertsRow: + g.panel.row.new('Alerts') + + g.panel.row.withPanels([ + panels.systemAlertsPanel { gridPos: { w: 6 } }, + panels.systemRecentAlertsPanel { gridPos: { w: 18 } }, + ]), + + // Instance overview dashboard rows + instanceResourcesRow: + g.panel.row.new('Resources') + + g.panel.row.withPanels([ + panels.instanceCpuUsagePanel { gridPos: { w: 12 } }, + panels.instanceDiskUsagePanel { gridPos: { w: 12 } }, + panels.instancePhysicalMemoryUsagePanel { gridPos: { w: 12 } }, + panels.instanceSchemaMemoryUsagePanel { gridPos: { w: 12 } }, + ]), + + instanceIORow: + g.panel.row.new('I/O') + + g.panel.row.withPanels([ + panels.instanceNetworkIOThroughputPanel { gridPos: { w: 12 } }, + panels.instanceDiskIOThroughputPanel { gridPos: { w: 12 } }, + ]), + + instancePerformanceRow: + g.panel.row.new('Performance') + + g.panel.row.withPanels([ + panels.instanceConnectionsPanel { gridPos: { w: 8 } }, + panels.instanceAvgQueryExecutionTimePanel { gridPos: { w: 8 } }, + panels.instanceAvgLockWaitTimePanel { gridPos: { w: 8 } }, + ]), + + instanceAlertsRow: + g.panel.row.new('Alerts') + + g.panel.row.withPanels([ + panels.instanceAlertsPanel { gridPos: { w: 7 } }, + panels.instanceRecentAlertsPanel { gridPos: { w: 17 } }, + ]), + + instanceOutliersRow: + g.panel.row.new('Outliers') + + g.panel.row.withPanels([ + panels.instanceTopTablesByMemoryPanel { gridPos: { w: 12 } }, + panels.instanceTopSQLByTimePanel { gridPos: { w: 12 } }, + ]), + }, +} diff --git a/sap-hana-mixin/signals/instance.libsonnet b/sap-hana-mixin/signals/instance.libsonnet new file mode 100644 index 000000000..29ed16191 --- /dev/null +++ b/sap-hana-mixin/signals/instance.libsonnet @@ -0,0 +1,163 @@ +function(this) { + local aggregationLabels = std.join(', ', this.groupLabels + this.instanceLabels), + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + cpuUsageByCore: { + name: 'CPU usage', + nameShort: 'CPU', + type: 'raw', + description: 'CPU usage percentage of the SAP HANA instance', + unit: 'percent', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', core) (hanadb_cpu_busy_percent{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - core {{core}}', + }, + }, + }, + + diskUsage: { + name: 'Disk usage', + nameShort: 'Disk', + type: 'raw', + description: 'Disk utilization percentage of the SAP HANA instance', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (' + aggregationLabels + ') (hanadb_disk_total_used_size_mb{%(queriesSelector)s}) / sum by (' + aggregationLabels + ') (hanadb_disk_total_size_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + physicalMemoryUsageResident: { + name: 'Physical memory usage - resident', + nameShort: 'Resident', + type: 'raw', + description: 'Physical memory utilization percentage (resident) of the SAP HANA instance', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (' + aggregationLabels + ') (hanadb_host_memory_resident_mb{%(queriesSelector)s}) / sum by (' + aggregationLabels + ') (hanadb_host_memory_physical_total_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - resident', + }, + }, + }, + + physicalMemoryUsageSwap: { + name: 'Physical memory usage - swap', + nameShort: 'Swap', + type: 'raw', + description: 'Physical memory utilization percentage (swap) of the SAP HANA instance', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (' + aggregationLabels + ') (hanadb_host_memory_swap_used_mb{%(queriesSelector)s}) / clamp_min(sum by (' + aggregationLabels + ') (hanadb_host_memory_swap_used_mb{%(queriesSelector)s} + hanadb_host_memory_swap_free_mb{%(queriesSelector)s}), 1)', + legendCustomTemplate: '{{host}} - swap', + }, + }, + }, + + schemaMemoryUsage: { + name: 'Schema memory usage', + nameShort: 'Schema memory', + type: 'gauge', + description: 'Total used memory by schema in the SAP HANA instance', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', database_name, schema_name) (hanadb_schema_used_memory_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{database_name}} - {{schema_name}}', + }, + }, + }, + + networkReceiveByInterface: { + name: 'Network receive rate', + nameShort: 'Receive', + type: 'raw', + description: 'Network I/O throughput for the SAP HANA instance', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', interface) (hanadb_network_receive_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{interface}} - receive', + }, + }, + }, + + networkTransmitByInterface: { + name: 'Network transmit rate', + nameShort: 'Transmit', + type: 'raw', + description: 'Network I/O throughput for the SAP HANA instance', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', interface) (hanadb_network_transmission_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{interface}} - transmit', + }, + }, + }, + + diskIOByDisk: { + name: 'Disk I/O throughput', + nameShort: 'Disk I/O', + type: 'raw', + description: 'Disk throughput for the SAP HANA instance', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', disk) (hanadb_disk_io_throughput_kb_second{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{disk}}', + }, + }, + }, + + connectionsByStatus: { + name: 'Connections', + nameShort: 'Connections', + type: 'raw', + description: 'Number of connections grouped by type and status in the SAP HANA instance', + unit: 'short', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', connection_type, connection_status) (hanadb_connections_total_count{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{connection_type}} - {{connection_status}}', + }, + }, + }, + + alertsCount: { + name: 'Alerts', + nameShort: 'Alerts', + type: 'raw', + description: "Count of the SAP HANA instance's current alerts", + unit: 'short', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ') (hanadb_alerts_current_rating{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + recentAlerts: { + name: 'Recent alerts', + nameShort: 'Recent alerts', + type: 'raw', + description: 'SAP HANA current alerts in the SAP HANA instance', + unit: 'short', + sources: { + prometheus: { + expr: 'hanadb_alerts_current_rating{%(queriesSelector)s}', + legendCustomTemplate: '{{host}}', + }, + }, + }, + }, +} diff --git a/sap-hana-mixin/signals/performance.libsonnet b/sap-hana-mixin/signals/performance.libsonnet new file mode 100644 index 000000000..8fe25bde4 --- /dev/null +++ b/sap-hana-mixin/signals/performance.libsonnet @@ -0,0 +1,66 @@ +function(this) { + local aggregationLabels = std.join(',', this.groupLabels + this.instanceLabels), + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + signals: { + avgQueryExecutionTime: { + name: 'Average query execution time', + nameShort: 'Query time', + type: 'raw', + description: 'Average elapsed time per execution by service and SQL type in the SAP HANA instance', + unit: 'ms', + sources: { + prometheus: { + expr: 'avg by (' + aggregationLabels + ', service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{service}} - {{sql_type}}', + }, + }, + }, + + avgLockWaitTime: { + name: 'Average lock wait execution time', + nameShort: 'Lock wait', + type: 'raw', + description: 'Average lock wait time per execution by service and SQL type in the SAP HANA instance', + unit: 'ms', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', service, sql_type) (hanadb_sql_service_lock_per_exec_ms{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{service}} - {{sql_type}}', + }, + }, + }, + + topTablesByMemory: { + name: 'Top tables by memory', + nameShort: 'Top tables', + type: 'raw', + description: 'Top tables by the sum of memory size in the main, delta, and history parts for the SAP HANA instance', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', database_name, table_name, schema_name) (topk(5, hanadb_table_cs_top_mem_total_mb{%(queriesSelector)s}))', + legendCustomTemplate: '{{host}} - {{database_name}} - {{schema_name}} - {{table_name}}', + }, + }, + }, + + topSQLByTime: { + name: 'Top SQL queries by average time', + nameShort: 'Top SQL', + type: 'raw', + description: 'Top statements by time consumed over all executions for the SAP HANA instance', + unit: 'µs', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', sql_hash) (hanadb_sql_top_time_consumers_mu{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - hash: {{sql_hash}}', + }, + }, + }, + }, +} diff --git a/sap-hana-mixin/signals/system.libsonnet b/sap-hana-mixin/signals/system.libsonnet new file mode 100644 index 000000000..9f7c79fb9 --- /dev/null +++ b/sap-hana-mixin/signals/system.libsonnet @@ -0,0 +1,221 @@ +function(this) { + local aggregationLabels = std.join(',', this.groupLabels + this.instanceLabels), + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'sum', + signals: { + + replicaStatus: { + name: 'Replica status', + nameShort: 'Status', + type: 'gauge', + description: 'State of the replicas in the SAP HANA system', + unit: 'short', + sources: { + prometheus: { + expr: 'hanadb_sr_replication{%(queriesSelector)s}', + legendCustomTemplate: '{{secondary_site_name}}', + }, + }, + }, + + replicationShipDelay: { + name: 'Average replication ship delay', + nameShort: 'Ship delay', + type: 'gauge', + description: 'Average system replication log shipping delay in the SAP HANA system', + unit: 's', + sources: { + prometheus: { + expr: 'avg by (' + aggregationLabels + ', secondary_site_name) (hanadb_sr_ship_delay{%(queriesSelector)s})', + legendCustomTemplate: '{{secondary_site_name}}', + }, + }, + }, + + cpuUsage: { + name: 'CPU usage', + nameShort: 'CPU', + type: 'raw', + description: 'CPU usage percentage of the SAP HANA system', + unit: 'percent', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', core) (hanadb_cpu_busy_percent{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - core {{core}}', + }, + }, + }, + + diskUsage: { + name: 'Disk usage', + nameShort: 'Disk', + type: 'raw', + description: 'Disk utilization percentage of the SAP HANA system', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (' + aggregationLabels + ') (hanadb_disk_total_used_size_mb{%(queriesSelector)s}) / sum by (' + aggregationLabels + ') (hanadb_disk_total_size_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + physicalMemoryUsageResident: { + name: 'Physical memory usage - resident', + nameShort: 'Resident', + type: 'raw', + description: 'Physical memory utilization percentage (resident) of the SAP HANA system', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (' + aggregationLabels + ') (hanadb_host_memory_resident_mb{%(queriesSelector)s}) / sum by (' + aggregationLabels + ') (hanadb_host_memory_physical_total_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - resident', + }, + }, + }, + + physicalMemoryUsageSwap: { + name: 'Physical memory usage - swap', + nameShort: 'Swap', + type: 'raw', + description: 'Physical memory utilization percentage (swap) of the SAP HANA system', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (' + aggregationLabels + ') (hanadb_host_memory_swap_used_mb{%(queriesSelector)s}) / clamp_min(sum by (' + aggregationLabels + ') (hanadb_host_memory_swap_used_mb{%(queriesSelector)s} + hanadb_host_memory_swap_free_mb{%(queriesSelector)s}), 1)', + legendCustomTemplate: '{{host}} - swap', + }, + }, + }, + + hanaMemoryUsage: { + name: 'SAP HANA memory usage', + nameShort: 'HANA memory', + type: 'raw', + description: 'Total amount of used memory by processes in the SAP HANA system', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (' + aggregationLabels + ') (hanadb_host_memory_used_total_mb{%(queriesSelector)s}) / sum by (' + aggregationLabels + ') (hanadb_host_memory_alloc_limit_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + networkReceiveRate: { + name: 'Network receive rate', + nameShort: 'Receive', + type: 'raw', + description: 'Network receive throughput in the SAP HANA system', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ') (hanadb_network_receive_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - receive', + }, + }, + }, + + networkTransmitRate: { + name: 'Network transmit rate', + nameShort: 'Transmit', + type: 'raw', + description: 'Network transmit throughput in the SAP HANA system', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ', interface) (hanadb_network_transmission_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - transmit', + }, + }, + }, + + diskIOThroughput: { + name: 'Disk I/O throughput', + nameShort: 'Disk I/O', + type: 'raw', + description: 'Disk throughput for the SAP HANA system', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ') (hanadb_disk_io_throughput_kb_second{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + activeConnections: { + name: 'Active connections', + nameShort: 'Active', + type: 'raw', + description: 'Number of connections in active states across the SAP HANA system', + unit: 'short', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ') (hanadb_connections_total_count{%(queriesSelector)s, connection_status=~"RUNNING|QUEUING"})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + idleConnections: { + name: 'Idle connections', + nameShort: 'Idle', + type: 'raw', + description: 'Number of connections in the idle state across the SAP HANA system', + unit: 'short', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ') (hanadb_connections_total_count{%(queriesSelector)s, connection_status=~"IDLE"})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + alertsCount: { + name: 'Alerts', + nameShort: 'Alerts', + type: 'raw', + description: 'Count of the SAP HANA current alerts in the SAP HANA system', + unit: 'short', + sources: { + prometheus: { + expr: 'sum by (' + aggregationLabels + ') (hanadb_alerts_current_rating{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + recentAlerts: { + name: 'Recent alerts', + nameShort: 'Recent alerts', + type: 'raw', + description: 'SAP HANA current alerts in the SAP HANA system', + unit: 'short', + sources: { + prometheus: { + expr: 'hanadb_alerts_current_rating{%(queriesSelector)s}', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + avgQueryExecutionTime: { + name: 'Average query execution time', + nameShort: 'Query time', + type: 'raw', + description: 'Average elapsed time per execution across the SAP HANA system', + unit: 'ms', + sources: { + prometheus: { + expr: 'avg by (' + aggregationLabels + ', service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - service: {{service}} - type: {{sql_type}}', + }, + }, + }, + }, +} From e7dcb7ad2c38a4e85f7b9c7019abc4839b968f05 Mon Sep 17 00:00:00 2001 From: schmikei Date: Thu, 20 Nov 2025 14:17:45 -0500 Subject: [PATCH 2/2] fix lint with alerts --- sap-hana-mixin/alerts.libsonnet | 10 +++++----- .../prometheus_rules_out/prometheus_alerts.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sap-hana-mixin/alerts.libsonnet b/sap-hana-mixin/alerts.libsonnet index 0e57cba62..1a205909f 100644 --- a/sap-hana-mixin/alerts.libsonnet +++ b/sap-hana-mixin/alerts.libsonnet @@ -24,7 +24,7 @@ { alert: 'SapHanaHighPhysicalMemoryUsage', expr: ||| - 100 * sum without (database_name)(hanadb_host_memory_resident_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) > %(alertsCriticalHighPhysicalMemoryUsage)s + 100 * sum by (job, sid, host)(hanadb_host_memory_resident_mb{%(filteringSelector)s}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) > %(alertsCriticalHighPhysicalMemoryUsage)s ||| % config, 'for': '5m', labels: { @@ -40,7 +40,7 @@ { alert: 'SapHanaMemAllocLimitBelowRecommendation', expr: ||| - 100 * sum without (database_name) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) < %(alertsWarningLowMemAllocLimit)s + 100 * sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) < %(alertsWarningLowMemAllocLimit)s ||| % config, 'for': '5m', labels: { @@ -56,7 +56,7 @@ { alert: 'SapHanaHighMemoryUsage', expr: ||| - 100 * sum without (database_name) (hanadb_host_memory_used_total_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) > %(alertsCriticalHighMemoryUsage)s + 100 * sum by (job, sid, host) (hanadb_host_memory_used_total_mb{%(filteringSelector)s}) / sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) > %(alertsCriticalHighMemoryUsage)s ||| % config, 'for': '5m', labels: { @@ -72,7 +72,7 @@ { alert: 'SapHanaHighDiskUtilization', expr: ||| - 100 * sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_used_size_mb{%(filteringSelector)s}) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb{%(filteringSelector)s}) > %(alertsCriticalHighDiskUtilization)s + 100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{%(filteringSelector)s}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{%(filteringSelector)s}) > %(alertsCriticalHighDiskUtilization)s ||| % config, 'for': '5m', labels: { @@ -81,7 +81,7 @@ annotations: { summary: 'SAP HANA disk is approaching capacity.', description: ( - 'The disk usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(filteringSelector)s%%.' + 'The disk usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighDiskUtilization)s%%.' ) % config, }, }, diff --git a/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml b/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml index 6415aeab9..4343e37a7 100644 --- a/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml +++ b/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml @@ -15,7 +15,7 @@ groups: description: The physical memory usage is at {{ printf "%.2f" $value }}% on {{$labels.host}} which is above the threshold of 80%. summary: Current physical memory usage of the host is approaching capacity. expr: | - 100 * sum without (database_name)(hanadb_host_memory_resident_mb{job="integrations/sap-hana"}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{job="integrations/sap-hana"}) > 80 + 100 * sum by (job, sid, host)(hanadb_host_memory_resident_mb{job="integrations/sap-hana"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job="integrations/sap-hana"}) > 80 for: 5m labels: severity: critical @@ -24,7 +24,7 @@ groups: description: The memory allocation limit is set at {{ printf "%.2f" $value }}% on {{$labels.host}} which is below the recommended value of 90%. summary: Memory allocation limit set below recommended limit. expr: | - 100 * sum without (database_name) (hanadb_host_memory_alloc_limit_mb{job="integrations/sap-hana"}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{job="integrations/sap-hana"}) < 90 + 100 * sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{job="integrations/sap-hana"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job="integrations/sap-hana"}) < 90 for: 5m labels: severity: warning @@ -33,16 +33,16 @@ groups: description: The memory usage is at {{ printf "%.2f" $value }}% on {{$labels.host}} which is above the threshold of 80%. summary: Current SAP HANA memory usage is approaching capacity. expr: | - 100 * sum without (database_name) (hanadb_host_memory_used_total_mb{job="integrations/sap-hana"}) / sum without (database_name) (hanadb_host_memory_alloc_limit_mb{job="integrations/sap-hana"}) > 80 + 100 * sum by (job, sid, host) (hanadb_host_memory_used_total_mb{job="integrations/sap-hana"}) / sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{job="integrations/sap-hana"}) > 80 for: 5m labels: severity: critical - alert: SapHanaHighDiskUtilization annotations: - description: The disk usage is at {{ printf "%.2f" $value }}% on {{$labels.host}} which is above the threshold of job="integrations/sap-hana"%. + description: The disk usage is at {{ printf "%.2f" $value }}% on {{$labels.host}} which is above the threshold of 80%. summary: SAP HANA disk is approaching capacity. expr: | - 100 * sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_used_size_mb{job="integrations/sap-hana"}) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb{job="integrations/sap-hana"}) > 80 + 100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{job="integrations/sap-hana"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job="integrations/sap-hana"}) > 80 for: 5m labels: severity: critical