diff --git a/.gitignore b/.gitignore index d68c86c04..1a57d51f0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vendor jsonnetfile.lock.json *.zip +.worktrees diff --git a/sap-hana-mixin/.lint b/sap-hana-mixin/.lint index 871a0f1b1..321e57e93 100644 --- a/sap-hana-mixin/.lint +++ b/sap-hana-mixin/.lint @@ -12,3 +12,5 @@ exclusions: reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" target-instance-rule: reason: "SAP HANA uses the label 'host' to identify separate instances" + panel-datasource-rule: + reason: "Modern mixins use signal-based architecture where datasource references are handled by the framework" diff --git a/sap-hana-mixin/alerts/alerts.libsonnet b/sap-hana-mixin/alerts.libsonnet similarity index 67% rename from sap-hana-mixin/alerts/alerts.libsonnet rename to sap-hana-mixin/alerts.libsonnet index 880defefa..deff147e8 100644 --- a/sap-hana-mixin/alerts/alerts.libsonnet +++ b/sap-hana-mixin/alerts.libsonnet @@ -1,14 +1,14 @@ { - prometheusAlerts+:: { - groups+: [ + new(this): { + groups: [ { - name: 'sap-hana-alerts', + name: this.config.uid + '-alerts', rules: [ { alert: 'SapHanaHighCpuUtilization', expr: ||| sum without (database_name) (hanadb_cpu_busy_percent) > %(alertsCriticalHighCpuUsage)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -17,15 +17,15 @@ 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, + 'The CPU usage is at {{$value}}%% on {{$labels.core}} on {{$labels.host}} which is above the threshold of %(alertsCriticalHighCpuUsage)s%%.' + ) % this.config, }, }, { - alert: 'SapHanaHighPhysicalMemoryUsage', + alert: 'SapHanaHighPhysicalMemory', expr: ||| 100 * sum without (database_name)(hanadb_host_memory_resident_mb) / sum without (database_name) (hanadb_host_memory_physical_total_mb) > %(alertsCriticalHighPhysicalMemoryUsage)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -34,15 +34,15 @@ 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, + 'The physical memory usage is at {{$value}}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighPhysicalMemoryUsage)s%%.' + ) % this.config, }, }, { - alert: 'SapHanaMemAllocLimitBelowRecommendation', + alert: 'SapHanaMemAllocBelowLimit', 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, + ||| % this.config, 'for': '5m', labels: { severity: 'warning', @@ -51,15 +51,15 @@ 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, + 'The memory allocation limit is set at {{$value}}%% on {{$labels.host}} which is below the recommended value of %(alertsWarningLowMemAllocLimit)s%%.' + ) % this.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, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -68,15 +68,15 @@ 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, + 'The memory usage is at {{$value}}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighMemoryUsage)s%%.' + ) % this.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, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -85,15 +85,15 @@ 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, + 'The disk usage is at {{$value}}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighDiskUtilization)s%%.' + ) % this.config, }, }, { alert: 'SapHanaHighSqlExecutionTime', expr: ||| avg without (database_name, port, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms) / 1000 > %(alertsCriticalHighSqlExecutionTime)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -102,15 +102,15 @@ 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, + 'The average SQL execution time is at {{$value}}s on {{$labels.host}} which is above the threshold of %(alertsCriticalHighSqlExecutionTime)ss.' + ) % this.config, }, }, { - alert: 'SapHanaHighReplicationShippingTime', + alert: 'SapHanaHighReplicationDelay', expr: ||| avg without (database_name, port, secondary_port, replication_mode) (hanadb_sr_ship_delay) > %(alertsCriticalHighReplicationShippingTime)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -119,15 +119,15 @@ 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, + 'The average system replication log shipping delay is at {{$value}}s from primary site {{$labels.site_name}} to replica site {{$labels.secondary_site_name}} which is above the threshold of %(alertsCriticalHighReplicationShippingTime)ss.' + ) % this.config, }, }, { - alert: 'SapHanaReplicationStatusError', + alert: 'SapHanaReplicationError', expr: ||| hanadb_sr_replication == 4 - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -137,7 +137,7 @@ description: ( 'The replication status of replica {{$labels.secondary_site_name}} is ERROR' - ) % $._config, + ) % this.config, }, }, ], diff --git a/sap-hana-mixin/config.libsonnet b/sap-hana-mixin/config.libsonnet index f655233c7..ee8788092 100644 --- a/sap-hana-mixin/config.libsonnet +++ b/sap-hana-mixin/config.libsonnet @@ -1,19 +1,48 @@ { - _config+:: { - dashboardTags: ['sap-hana-mixin'], - dashboardPeriod: 'now-1h', - dashboardTimezone: 'default', - dashboardRefresh: '1m', + local this = self, - // 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 + // Basic filtering + filteringSelector: 'job=~"$job", sid=~"$sid"', + groupLabels: ['job', 'sid'], + instanceLabels: ['host'], - enableLokiLogs: true, + // Dashboard settings + dashboardTags: ['sap-hana-mixin'], + uid: 'sap-hana', + dashboardNamePrefix: 'SAP HANA', + dashboardRefresh: '1m', + dashboardPeriod: 'now-1h', + dashboardTimezone: 'default', + + // Logs configuration + enableLokiLogs: true, + logLabels: ['job', 'sid', 'host', 'filename'], + extraLogLabels: [], + logsVolumeGroupBy: 'level', + showLogsVolume: true, + + // Alert thresholds + alertsCriticalHighCpuUsage: 80, // % + alertsCriticalHighPhysicalMemoryUsage: 80, // % + alertsWarningLowMemAllocLimit: 90, // % + alertsCriticalHighMemoryUsage: 80, // % + alertsCriticalHighDiskUtilization: 80, // % + alertsCriticalHighSqlExecutionTime: 1, // s + alertsCriticalHighReplicationShippingTime: 1, // s + + // Metrics source + metricsSource: 'prometheus', + + // Signals + signals+: { + cpu: (import './signals/cpu.libsonnet')(this), + memory: (import './signals/memory.libsonnet')(this), + disk: (import './signals/disk.libsonnet')(this), + network: (import './signals/network.libsonnet')(this), + replication: (import './signals/replication.libsonnet')(this), + sql: (import './signals/sql.libsonnet')(this), + connections: (import './signals/connections.libsonnet')(this), + storage: (import './signals/storage.libsonnet')(this), + alerts: (import './signals/alerts.libsonnet')(this), }, } diff --git a/sap-hana-mixin/dashboards.libsonnet b/sap-hana-mixin/dashboards.libsonnet new file mode 100644 index 000000000..a051c8daf --- /dev/null +++ b/sap-hana-mixin/dashboards.libsonnet @@ -0,0 +1,162 @@ +local g = import './g.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 = g.util.string.slugify(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; + + { + // SAP HANA system overview dashboard + 'sap-hana-system-overview.json': + g.dashboard.new(prefix + ' system overview') + + g.dashboard.withDescription('Dashboard providing an overview of SAP HANA system performance and health.') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels( + [ + this.grafana.rows.systemReplication, + this.grafana.rows.systemResources, + this.grafana.rows.systemNetwork, + this.grafana.rows.systemDisk, + this.grafana.rows.systemSQL, + this.grafana.rows.systemConnections, + this.grafana.rows.systemStorage, + this.grafana.rows.systemAlerts, + ] + ) + ) + ) + + root.applyCommon( + std.filter( + function(x) x.name != 'host', + vars.multiInstance, + ) + [ + // Add SID variable for SAP HANA system ID + g.dashboard.variable.query.new('sid') + + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus) + + g.dashboard.variable.query.queryTypes.withLabelValues('sid', 'hanadb_cpu_busy_percent{job=~"$job"}') + + g.dashboard.variable.query.generalOptions.withLabel('SID') + + g.dashboard.variable.query.selectionOptions.withMulti(true) + + g.dashboard.variable.query.selectionOptions.withIncludeAll(true, '.+') + + g.dashboard.variable.query.refresh.onLoad() + + g.dashboard.variable.query.refresh.onTime(), + ], + uid + '_system_overview', + tags, + links { sapHanaSystemOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + // SAP HANA instance overview dashboard + 'sap-hana-instance-overview.json': + g.dashboard.new(prefix + ' instance overview') + + g.dashboard.withDescription('Dashboard providing detailed overview of SAP HANA instance performance.') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels( + [ + this.grafana.rows.instanceOverview, + this.grafana.rows.instanceMemory, + this.grafana.rows.instanceNetwork, + this.grafana.rows.instanceSQL, + ] + ) + ) + ) + + root.applyCommon( + vars.multiInstance + [ + // Add SID variable + g.dashboard.variable.query.new('sid') + + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus) + + g.dashboard.variable.query.queryTypes.withLabelValues('sid', 'hanadb_cpu_busy_percent{job=~"$job"}') + + g.dashboard.variable.query.generalOptions.withLabel('SID') + + g.dashboard.variable.query.selectionOptions.withMulti(true) + + g.dashboard.variable.query.selectionOptions.withIncludeAll(true, '.+') + + g.dashboard.variable.query.refresh.onLoad() + + g.dashboard.variable.query.refresh.onTime(), + ], + uid + '_instance_overview', + tags, + links { sapHanaInstanceOverview+:: {} }, + 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.logLabels + this.config.extraLogLabels, + formatParser=null, + showLogsVolume=this.config.showLogsVolume, + logsVolumeGroupBy=this.config.logsVolumeGroupBy, + ) + { + dashboards+: + { + logs+: + root.applyCommon( + super.logs.templating.list, + uid=uid + '_logs', + tags=tags, + links=links { logs+:: {} }, + 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 }, + // Add SID variable for logs + g.dashboard.variable.query.new('sid') + + g.dashboard.variable.query.withDatasourceFromVariable(this.grafana.variables.datasources.loki) + + g.dashboard.variable.query.queryTypes.withLabelValues('sid', '{job=~"$job"}') + + g.dashboard.variable.query.generalOptions.withLabel('SID') + + g.dashboard.variable.query.selectionOptions.withMulti(true) + + g.dashboard.variable.query.selectionOptions.withIncludeAll(true, '.+') + + g.dashboard.variable.query.refresh.onLoad() + + g.dashboard.variable.query.refresh.onTime(), + ], + }, + }.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)), +} 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..f0e08736a 100644 --- a/sap-hana-mixin/dashboards_out/sap-hana-instance-overview.json +++ b/sap-hana-mixin/dashboards_out/sap-hana-instance-overview.json @@ -1,74 +1,55 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, + "description": "Dashboard providing detailed overview of SAP HANA instance performance.", "links": [ { - "asDropdown": false, - "icon": "external link", + "keepTime": true, + "title": "SAP HANA logs", + "type": "link", + "url": "/d/saphana_logs" + }, + { + "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 system overview", + "type": "link", + "url": "/d/saphana_system_overview" } ], "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [ ], + "title": "Instance overview", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "CPU usage percentage of the SAP HANA instance", + "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", - "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", @@ -81,37 +62,33 @@ ] }, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 0 + "y": 1 }, "id": 2, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - core {{core}}" + "instant": false, + "legendFormat": "{{host}} - core {{core}}", + "refId": "CPU busy percent by host" } ], "title": "CPU usage", @@ -119,47 +96,13 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Disk utilization percentage of the SAP HANA instance", + "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", @@ -172,85 +115,60 @@ ] }, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 0 + "y": 1 }, "id": 3, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Disk usage percent" } ], "title": "Disk usage", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 7 + }, + "id": 4, + "panels": [ ], + "title": "Memory", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Physical memory utilization percentage of the SAP HANA instance", + "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", @@ -263,46 +181,44 @@ ] }, "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 - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - resident" + "instant": false, + "legendFormat": "{{host}} - resident", + "refId": "Physical memory usage percent" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / (sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) + sum by (job, sid, host) (hanadb_host_memory_swap_free_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - swap" + "instant": false, + "legendFormat": "{{host}} - swap", + "refId": "Swap memory usage percent" } ], "title": "Physical memory usage", @@ -310,47 +226,13 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Total used memory by schema in the SAP HANA instance", + "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": "off" - } - }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -362,792 +244,178 @@ } ] }, - "unit": "decmbytes" - }, - "overrides": [ ] + "unit": "percent" + } }, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 6 + "y": 8 }, - "id": 5, + "id": 6, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${datasource}" }, - "expr": "sum by (job, sid, host, database_name, schema_name) (hanadb_schema_used_memory_mb{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_used_total_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{database_name}} - {{schema_name}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "SAP HANA memory usage percent" } ], - "title": "Schema memory usage", + "title": "SAP HANA memory usage", "type": "timeseries" }, { - "datasource": { - "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 - } - ] - }, - "unit": "KBs" - }, - "overrides": [ ] - }, + "collapsed": false, "gridPos": { - "h": 6, - "w": 12, + "h": 1, + "w": 0, "x": 0, - "y": 12 + "y": 14 }, - "id": 6, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by (job, sid, host, interface) (hanadb_network_receive_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{interface}} - receive" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by (job, sid, host, interface) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{interface}} - transmit" - } - ], - "title": "Network I/O throughput", - "type": "timeseries" + "id": 7, + "panels": [ ], + "title": "Network", + "type": "row" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Disk throughput for the SAP HANA instance", + "description": "Network receive and transmit rate in KB/s", "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": [ ] - }, - "gridPos": { - "h": 6, - "w": 12, - "x": 12, - "y": 12 - }, - "id": 7, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" } }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by (job, sid, host, disk) (hanadb_disk_io_throughput_kb_second{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{disk}}" - } - ], - "title": "Disk I/O throughput", - "type": "timeseries" - }, - { - "datasource": { - "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" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] - }, "gridPos": { "h": 6, - "w": 8, + "w": 12, "x": 0, - "y": 18 + "y": 15 }, "id": 8, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.2-cloud.1.f9fd074b", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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) (hanadb_network_receive_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{connection_type}} - {{connection_status}}" - } - ], - "title": "Connections", - "type": "timeseries" - }, - { - "datasource": { - "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 - } - ] - }, - "unit": "ms" + "instant": false, + "legendFormat": "{{host}} - receive", + "refId": "Network receive rate" }, - "overrides": [ ] - }, - "gridPos": { - "h": 6, - "w": 8, - "x": 8, - "y": 18 - }, - "id": 9, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "9.5.0-cloud.5.a016665c", - "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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": "sum by (job, sid, host) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{service}} - {{sql_type}}" + "instant": false, + "legendFormat": "{{host}} - transmit", + "refId": "Network transmission rate" } ], - "title": "Average query execution time", + "title": "Network I/O throughput", "type": "timeseries" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Average lock wait time per execution by service and SQL type in the SAP HANA instance", + "description": "Network receive and transmit rate by interface in KB/s", "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": [ ] + "unit": "KBs" + } }, "gridPos": { "h": 6, - "w": 8, - "x": 16, - "y": 18 + "w": 12, + "x": 12, + "y": 15 }, - "id": 10, + "id": 9, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.0-cloud.5.a016665c", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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, interface) (hanadb_network_receive_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{service}} - {{sql_type}}" - } - ], - "title": "Average lock wait execution time", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 24 - }, - "id": 11, - "targets": [ ], - "title": "Alerts", - "type": "row" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "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": [ ] - }, - "gridPos": { - "h": 6, - "w": 7, - "x": 0, - "y": 25 - }, - "id": 12, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "instant": false, + "legendFormat": "{{host}} - {{interface}} - receive", + "refId": "Network receive rate by interface" }, - "textMode": "auto" - }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", - "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"})", + "expr": "sum by (job, sid, host, interface) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}} - {{interface}} - transmit", + "refId": "Network transmission rate by interface" } ], - "title": "Alerts", - "type": "stat" - }, - { - "datasource": { - "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, - "w": 17, - "x": 7, - "y": 25 - }, - "id": 13, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\", host=~\"$host\"}", - "format": "table", - "intervalFactor": 2, - "legendFormat": "{{alert_details}} {{alert_useraction}}" - } - ], - "title": "Recent alerts", - "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)" - } - } - } - ], - "type": "table" + "title": "Network I/O throughput by interface", + "type": "timeseries" }, { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, - "y": 31 + "y": 21 }, - "id": 14, - "targets": [ ], - "title": "Outliers", + "id": 10, + "panels": [ ], + "title": "SQL", "type": "row" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Top tables by the sum of memory size in the main, delta, and history parts for the SAP HANA instance", + "description": "Average SQL service elapsed time per execution", "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", @@ -1155,274 +423,165 @@ }, { "color": "red", - "value": 80 + "value": 1000 } ] }, - "unit": "decmbytes" - }, - "overrides": [ ] + "unit": "ms" + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 32 + "y": 22 }, - "id": 15, + "id": 11, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.0-cloud.5.a016665c", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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": "avg by (job, sid, host, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - {{database_name}} - {{schema_name}} - {{table_name}}" + "instant": false, + "legendFormat": "{{host}} - service: {{service}} - type: {{sql_type}}", + "refId": "SQL service elapsed time per execution" } ], - "title": "Top tables by memory", + "title": "Average SQL execution time", "type": "timeseries" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Top statements by time consumed over all executions for the SAP HANA instance", + "description": "SQL service lock time per execution", "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": [ ] + "unit": "ms" + } }, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 32 + "y": 22 }, - "id": 16, + "id": 12, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, - "pluginVersion": "9.5.0-cloud.5.a016665c", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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, service, sql_type) (hanadb_sql_service_lock_per_exec_ms{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - hash: {{sql_hash}}" + "instant": false, + "legendFormat": "{{host}} - {{service}} - {{sql_type}}", + "refId": "SQL service lock time per execution" } ], - "title": "Top SQL queries by average time", + "title": "SQL lock 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=~\"$job\", sid=~\"$sid\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, - "label": "SAP HANA system", - "multi": false, + "includeAll": true, + "label": "Sid", + "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=~\"$job\", sid=~\"$sid\",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, + "label": "Host", + "multi": true, "name": "host", - "options": [ ], - "query": "label_values(hanadb_cpu_busy_percent,host)", - "refresh": 1, + "query": "label_values(hanadb_cpu_busy_percent{job=~\"$job\", sid=~\"$sid\",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" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "SID", + "multi": true, + "name": "sid", + "query": "label_values(hanadb_cpu_busy_percent{job=~\"$job\"}, sid)", + "refresh": 2, + "type": "query" } ] }, @@ -1430,33 +589,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": "saphana_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..57fddd519 --- /dev/null +++ b/sap-hana-mixin/dashboards_out/sap-hana-logs.json @@ -0,0 +1,348 @@ +{ + "annotations": { + "list": [ ] + }, + "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/saphana_instance_overview" + }, + { + "keepTime": true, + "title": "SAP HANA system overview", + "type": "link", + "url": "/d/saphana_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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\",filename=~\"$filename\"}\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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\",filename=~\"$filename\"} \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=~\"$job\", sid=~\"$sid\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Sid", + "multi": true, + "name": "sid", + "query": "label_values({job=~\"$job\", sid=~\"$sid\",job=~\"$job\"}, sid)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Host", + "multi": true, + "name": "host", + "query": "label_values({job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\"}, host)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Filename", + "multi": true, + "name": "filename", + "query": "label_values({job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}, filename)", + "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" + }, + { + "allValue": ".+", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "SID", + "multi": true, + "name": "sid", + "query": "label_values({job=~\"$job\"}, sid)", + "refresh": 2, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "default", + "title": "SAP HANA logs", + "uid": "saphana_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..b5b9b33bf 100644 --- a/sap-hana-mixin/dashboards_out/sap-hana-system-overview.json +++ b/sap-hana-mixin/dashboards_out/sap-hana-system-overview.json @@ -1,34 +1,50 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, + "description": "Dashboard providing an overview of SAP HANA system performance and health.", "links": [ { - "asDropdown": false, - "icon": "external link", + "keepTime": true, + "title": "SAP HANA logs", + "type": "link", + "url": "/d/saphana_logs" + }, + { + "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/saphana_instance_overview" } ], "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [ ], + "title": "System replication", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "State of the replicas in the SAP HANA system", "fieldConfig": { @@ -74,7 +90,6 @@ } ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -94,40 +109,36 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, - "w": 9, + "w": 8, "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.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${datasource}" }, - "expr": "hanadb_sr_replication{job=~\"$job\", sid=~\"$sid\"}", + "expr": "hanadb_sr_replication{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{secondary_site_name}}" + "instant": false, + "legendFormat": "{{secondary_site_name}}", + "refId": "System replication status" } ], "title": "Replica status", @@ -135,47 +146,13 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "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" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -188,88 +165,60 @@ ] }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, - "w": 15, - "x": 9, - "y": 0 + "w": 16, + "x": 8, + "y": 1 }, "id": 3, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${datasource}" }, - "expr": "avg by (job, sid, secondary_site_name) (hanadb_sr_ship_delay{job=~\"$job\", sid=~\"$sid\"})", + "expr": "avg by (job, sid, secondary_site_name) (hanadb_sr_ship_delay{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{secondary_site_name}}" + "instant": false, + "legendFormat": "{{secondary_site_name}}", + "refId": "System 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": "System resources", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "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", @@ -282,37 +231,33 @@ ] }, "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 - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - core {{core}}" + "instant": false, + "legendFormat": "{{host}} - core {{core}}", + "refId": "CPU busy percent by host" } ], "title": "CPU usage", @@ -320,47 +265,13 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "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", @@ -373,37 +284,33 @@ ] }, "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 - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Disk usage percent" } ], "title": "Disk usage", @@ -411,47 +318,13 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "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", @@ -464,46 +337,44 @@ ] }, "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 - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - resident" + "instant": false, + "legendFormat": "{{host}} - resident", + "refId": "Physical memory usage percent" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / (sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) + sum by (job, sid, host) (hanadb_host_memory_swap_free_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - swap" + "instant": false, + "legendFormat": "{{host}} - swap", + "refId": "Swap memory usage percent" } ], "title": "Physical memory usage", @@ -511,47 +382,13 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "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", @@ -564,37 +401,33 @@ ] }, "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 - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "SAP HANA memory usage percent" } ], "title": "SAP HANA memory usage", @@ -602,99 +435,158 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Network I/O throughput in the SAP HANA system", + "description": "Memory allocation limit as a percentage of total physical memory", "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": null }, { - "color": "red", - "value": 80 + "color": "green", + "value": 90 } ] }, + "unit": "percent" + } + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 20 + }, + "id": 9, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "100 * sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}}", + "refId": "Memory allocation limit percent" + } + ], + "title": "Memory allocation limit", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Memory used by SAP HANA schemas", + "fieldConfig": { + "defaults": { + "unit": "decmbytes" + } + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 20 + }, + "id": 10, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum by (job, sid, host, database_name, schema_name) (hanadb_schema_used_memory_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}} - {{database_name}} - {{schema_name}}", + "refId": "Schema used memory" + } + ], + "title": "Schema memory usage", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 26 + }, + "id": 11, + "panels": [ ], + "title": "Network I/O", + "type": "row" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Network receive and transmit rate in KB/s", + "fieldConfig": { + "defaults": { "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 18 + "y": 27 }, - "id": 8, + "id": 12, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - receive" + "instant": false, + "legendFormat": "{{host}} - receive", + "refId": "Network receive rate" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${datasource}" }, - "expr": "sum by (job, sid, host) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\"})", + "expr": "sum by (job, sid, host) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}} - transmit" + "instant": false, + "legendFormat": "{{host}} - transmit", + "refId": "Network transmission rate" } ], "title": "Network I/O throughput", @@ -702,90 +594,105 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Disk throughput for the SAP HANA system", + "description": "Network receive and transmit rate by interface in KB/s", "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": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 18 + "y": 27 }, - "id": 9, + "id": 13, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum by (job, sid, host, interface) (hanadb_network_receive_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}} - {{interface}} - receive", + "refId": "Network receive rate by interface" }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum by (job, sid, host, interface) (hanadb_network_transmission_rate_kb_per_seconds{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}} - {{interface}} - transmit", + "refId": "Network transmission rate by interface" + } + ], + "title": "Network I/O throughput by interface", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 33 + }, + "id": 14, + "panels": [ ], + "title": "Disk I/O", + "type": "row" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Disk I/O throughput in KB/s", + "fieldConfig": { + "defaults": { + "unit": "KBs" + } + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 34 + }, + "id": 15, + "options": { "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",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", @@ -793,511 +700,481 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Average elapsed time per execution across the SAP HANA system", + "description": "Disk I/O throughput by disk device in KB/s", "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" - } + "unit": "KBs" + } + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 34 + }, + "id": 16, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" }, - "mappings": [ ], + "expr": "sum by (job, sid, host, disk) (hanadb_disk_io_throughput_kb_second{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}} - {{disk}}", + "refId": "Disk I/O throughput by disk" + } + ], + "title": "Disk I/O throughput by disk", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 40 + }, + "id": 17, + "panels": [ ], + "title": "SQL performance", + "type": "row" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Average SQL service elapsed time per execution", + "fieldConfig": { + "defaults": { "thresholds": { - "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 1000 } ] }, "unit": "ms" - }, - "overrides": [ ] + } }, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 24 + "y": 41 }, - "id": 10, + "id": 18, "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",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": "SQL service elapsed time per execution" } ], - "title": "Average query execution time", + "title": "Average SQL execution time", "type": "timeseries" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Number of connections in active states across the SAP HANA system", + "description": "SQL service lock time per execution", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "blue", - "mode": "fixed" - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] + "unit": "ms" + } }, "gridPos": { "h": 6, - "w": 6, + "w": 12, "x": 12, - "y": 24 + "y": 41 }, - "id": 11, + "id": 19, "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + "tooltip": { + "mode": "multi", + "sort": "desc" + } }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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, service, sql_type) (hanadb_sql_service_lock_per_exec_ms{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}} - {{service}} - {{sql_type}}", + "refId": "SQL service lock time per execution" } ], - "title": "Active connections", - "type": "stat" + "title": "SQL lock time", + "type": "timeseries" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Number of connections in the idle state across the SAP HANA system", + "description": "Top SQL time consumers", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "blue", - "mode": "fixed" + "unit": "µs" + } + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 47 + }, + "id": 20, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] + "expr": "sum by (job, sid, host, sql_hash) (hanadb_sql_top_time_consumers_mu{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}} - hash: {{sql_hash}}", + "refId": "SQL top time consumers" + } + ], + "title": "SQL top time consumers", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 53 }, + "id": 21, + "panels": [ ], + "title": "Connections", + "type": "row" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Total count of database connections", "gridPos": { "h": 6, - "w": 6, - "x": 18, - "y": 24 + "w": 8, + "x": 0, + "y": 54 }, - "id": 12, + "id": 22, "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", + "graphMode": "area", "reduceOptions": { "calcs": [ "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + ] + } }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Total connections count" } ], - "title": "Idle connections", + "title": "Total connections", "type": "stat" }, { - "collapsed": false, "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, + "description": "Database connections by type and status", + "gridPos": { + "h": 6, + "w": 16, + "x": 8, + "y": 54 + }, + "id": 23, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum by (job, sid, host, connection_type, connection_status) (hanadb_connections_total_count{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}} - {{connection_type}} - {{connection_status}}", + "refId": "Total connections count by type" + } + ], + "title": "Connections by type", + "type": "timeseries" + }, + { + "collapsed": false, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, - "y": 30 + "y": 60 }, - "id": 13, - "targets": [ ], - "title": "Alerts", + "id": 24, + "panels": [ ], + "title": "Storage", "type": "row" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Count of the SAP HANA current alerts in the SAP HANA system", + "description": "Top table column store memory consumption", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "yellow", - "mode": "thresholds" + "unit": "decmbytes" + } + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 61 + }, + "id": 25, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "green", - "value": 0 - }, - { - "color": "#EAB839", - "value": 1 - } - ] - } - }, - "overrides": [ ] + "expr": "sum by (job, sid, host, database_name, schema_name, table_name) (hanadb_table_cs_top_mem_total_mb{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", + "format": "time_series", + "instant": false, + "legendFormat": "{{host}} - {{database_name}} - {{schema_name}} - {{table_name}}", + "refId": "Table column store top memory" + } + ], + "title": "Top table memory", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 67 + }, + "id": 26, + "panels": [ ], + "title": "System alerts", + "type": "row" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" }, + "description": "Count of current system alerts", "gridPos": { "h": 6, - "w": 6, + "w": 8, "x": 0, - "y": 31 + "y": 68 }, - "id": 14, + "id": 27, "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", + "graphMode": "area", "reduceOptions": { "calcs": [ "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + ] + } }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${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=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{host}}" + "instant": false, + "legendFormat": "{{host}}", + "refId": "Current alerts rating" } ], - "title": "Alerts", + "title": "Current alerts", "type": "stat" }, { "datasource": { - "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": [ ] + "type": "datasource", + "uid": "-- Mixed --" }, + "description": "Detailed current system alerts", "gridPos": { "h": 6, - "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 + "w": 16, + "x": 8, + "y": 68 }, - "pluginVersion": "9.5.2-cloud.2.0cb5a501", + "id": 28, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { - "uid": "${prometheus_datasource}" + "type": "prometheus", + "uid": "${datasource}" }, - "expr": "hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\"}", + "expr": "hanadb_alerts_current_rating{job=~\"$job\", sid=~\"$sid\",job=~\"$job\",sid=~\"$sid\",host=~\"$host\"}", "format": "table", - "intervalFactor": 2, - "legendFormat": "" - } - ], - "title": "Recent alerts", - "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)" - } - } + "instant": true, + "legendFormat": "{{alert_details}} {{alert_useraction}}", + "refId": "Current alerts rating detail" } ], + "title": "Alerts detail", "type": "table" } ], "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=~\"$job\", sid=~\"$sid\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, - "label": "SAP HANA system", - "multi": false, + "includeAll": true, + "label": "Sid", + "multi": true, "name": "sid", - "options": [ ], - "query": "label_values(hanadb_cpu_busy_percent,sid)", - "refresh": 1, + "query": "label_values(hanadb_cpu_busy_percent{job=~\"$job\", sid=~\"$sid\",job=~\"$job\"}, sid)", + "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" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "SID", + "multi": true, + "name": "sid", + "query": "label_values(hanadb_cpu_busy_percent{job=~\"$job\"}, sid)", + "refresh": 2, + "type": "query" } ] }, @@ -1305,33 +1182,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": "saphana_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..ba90fd9b0 --- /dev/null +++ b/sap-hana-mixin/g.libsonnet @@ -0,0 +1,3 @@ +// grafonnet must be imported with "g" alias +local g = import './vendor/grafonnet-v11.0.0/main.libsonnet'; +g diff --git a/sap-hana-mixin/jsonnetfile.json b/sap-hana-mixin/jsonnetfile.json index 65cebf84b..cd4c0af70 100644 --- a/sap-hana-mixin/jsonnetfile.json +++ b/sap-hana-mixin/jsonnetfile.json @@ -1,15 +1,33 @@ { - "version": 1, - "dependencies": [ - { - "source": { - "git": { - "remote": "https://github.com/grafana/grafonnet-lib.git", - "subdir": "grafonnet" - } - }, - "version": "master" + "version": 1, + "dependencies": [ + { + "source": { + "git": { + "remote": "https://github.com/grafana/grafonnet", + "subdir": "gen/grafonnet-v11.0.0" } - ], - "legacyImports": true + }, + "version": "main" + }, + { + "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": "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..c51a0895e --- /dev/null +++ b/sap-hana-mixin/links.libsonnet @@ -0,0 +1,27 @@ +local g = import './g.libsonnet'; + +{ + local link = g.dashboard.link, + new(this): { + sapHanaSystemOverview: + link.link.new(this.config.dashboardNamePrefix + ' system overview', '/d/' + this.grafana.dashboards['sap-hana-system-overview.json'].uid) + + link.link.options.withKeepTime(true), + + sapHanaInstanceOverview: + link.link.new(this.config.dashboardNamePrefix + ' 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 + { + logs: + link.link.new(this.config.dashboardNamePrefix + ' 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..32932acd9 --- /dev/null +++ b/sap-hana-mixin/main.libsonnet @@ -0,0 +1,49 @@ +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', + customAllValue='.+', + 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..6505b8440 100644 --- a/sap-hana-mixin/mixin.libsonnet +++ b/sap-hana-mixin/mixin.libsonnet @@ -1,3 +1,15 @@ -(import 'dashboards/dashboards.libsonnet') + -(import 'alerts/alerts.libsonnet') + -(import 'config.libsonnet') +local lib = import './main.libsonnet'; + +local sapHana = + lib.new() + + lib.withConfigMixin({ + // Override defaults if needed + }); + +{ + grafanaDashboards+:: sapHana.grafana.dashboards, + prometheusAlerts+:: sapHana.prometheus.alerts, + prometheusRules+:: { + groups+: [], + }, +} diff --git a/sap-hana-mixin/panels.libsonnet b/sap-hana-mixin/panels.libsonnet new file mode 100644 index 000000000..e50abc692 --- /dev/null +++ b/sap-hana-mixin/panels.libsonnet @@ -0,0 +1,263 @@ +local g = (import './g.libsonnet'); +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + new(this):: + { + local signals = this.signals, + + // Replication panels + replicaStatus: + g.panel.stat.new('Replica status') + + g.panel.stat.panelOptions.withDescription('State of the replicas in the SAP HANA system') + + g.panel.stat.queryOptions.withTargets([ + signals.replication.sr_replication.asTarget(), + ]) + + g.panel.stat.standardOptions.color.withMode('thresholds') + + g.panel.stat.standardOptions.withMappings([ + g.panel.stat.standardOptions.mapping.ValueMap.withType() + + g.panel.stat.standardOptions.mapping.ValueMap.withOptions({ + '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' }, + }), + ]) + + g.panel.stat.standardOptions.thresholds.withSteps([ + g.panel.stat.thresholdStep.withColor('green') + g.panel.stat.thresholdStep.withValue(null), + g.panel.stat.thresholdStep.withColor('green') + g.panel.stat.thresholdStep.withValue(0), + g.panel.stat.thresholdStep.withColor('yellow') + g.panel.stat.thresholdStep.withValue(1), + g.panel.stat.thresholdStep.withColor('red') + g.panel.stat.thresholdStep.withValue(3), + ]) + + g.panel.stat.options.withColorMode('value') + + g.panel.stat.options.withGraphMode('none') + + g.panel.stat.options.reduceOptions.withCalcs(['lastNotNull']), + + averageReplicationShipDelay: + g.panel.timeSeries.new('Average replication ship delay') + + g.panel.timeSeries.panelOptions.withDescription('Average system replication log shipping delay in the SAP HANA system') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.replication.sr_ship_delay.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + g.panel.timeSeries.thresholdStep.withColor('green') + g.panel.timeSeries.thresholdStep.withValue(null), + g.panel.timeSeries.thresholdStep.withColor('red') + g.panel.timeSeries.thresholdStep.withValue(1), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // CPU panels + cpuUsage: + g.panel.timeSeries.new('CPU usage') + + g.panel.timeSeries.panelOptions.withDescription('CPU usage percentage of the SAP HANA system') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.cpu.cpu_busy_percent_by_host.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + g.panel.timeSeries.thresholdStep.withColor('green') + g.panel.timeSeries.thresholdStep.withValue(null), + g.panel.timeSeries.thresholdStep.withColor('red') + g.panel.timeSeries.thresholdStep.withValue(80), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // Disk panels + diskUsage: + g.panel.timeSeries.new('Disk usage') + + g.panel.timeSeries.panelOptions.withDescription('Disk utilization percentage of the SAP HANA system') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.disk.disk_usage_percent.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + g.panel.timeSeries.thresholdStep.withColor('green') + g.panel.timeSeries.thresholdStep.withValue(null), + g.panel.timeSeries.thresholdStep.withColor('red') + g.panel.timeSeries.thresholdStep.withValue(80), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + diskIOThroughput: + g.panel.timeSeries.new('Disk I/O throughput') + + g.panel.timeSeries.panelOptions.withDescription('Disk I/O throughput in KB/s') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.disk.disk_io_throughput_kb_second.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('KBs') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + diskIOThroughputByDisk: + g.panel.timeSeries.new('Disk I/O throughput by disk') + + g.panel.timeSeries.panelOptions.withDescription('Disk I/O throughput by disk device in KB/s') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.disk.disk_io_throughput_kb_second_by_disk.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('KBs') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // Memory panels + physicalMemoryUsage: + g.panel.timeSeries.new('Physical memory usage') + + g.panel.timeSeries.panelOptions.withDescription('Physical memory utilization percentage of the SAP HANA system') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.memory.physical_memory_usage_percent.asTarget(), + signals.memory.swap_memory_usage_percent.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + g.panel.timeSeries.thresholdStep.withColor('green') + g.panel.timeSeries.thresholdStep.withValue(null), + g.panel.timeSeries.thresholdStep.withColor('red') + g.panel.timeSeries.thresholdStep.withValue(80), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + sapHanaMemoryUsage: + g.panel.timeSeries.new('SAP HANA memory usage') + + g.panel.timeSeries.panelOptions.withDescription('Total amount of used memory by processes in the SAP HANA system') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.memory.hana_memory_usage_percent.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + g.panel.timeSeries.thresholdStep.withColor('green') + g.panel.timeSeries.thresholdStep.withValue(null), + g.panel.timeSeries.thresholdStep.withColor('red') + g.panel.timeSeries.thresholdStep.withValue(80), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + memoryAllocationLimit: + g.panel.timeSeries.new('Memory allocation limit') + + g.panel.timeSeries.panelOptions.withDescription('Memory allocation limit as a percentage of total physical memory') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.memory.memory_alloc_limit_percent.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + g.panel.timeSeries.thresholdStep.withColor('red') + g.panel.timeSeries.thresholdStep.withValue(null), + g.panel.timeSeries.thresholdStep.withColor('green') + g.panel.timeSeries.thresholdStep.withValue(90), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + schemaMemoryUsage: + g.panel.timeSeries.new('Schema memory usage') + + g.panel.timeSeries.panelOptions.withDescription('Memory used by SAP HANA schemas') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.memory.schema_used_memory_mb.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('decmbytes') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // Network panels + networkIOThroughput: + g.panel.timeSeries.new('Network I/O throughput') + + g.panel.timeSeries.panelOptions.withDescription('Network receive and transmit rate in KB/s') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.network.network_receive_rate_kb_per_seconds.asTarget(), + signals.network.network_transmission_rate_kb_per_seconds.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('KBs') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + networkIOThroughputByInterface: + g.panel.timeSeries.new('Network I/O throughput by interface') + + g.panel.timeSeries.panelOptions.withDescription('Network receive and transmit rate by interface in KB/s') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.network.network_receive_rate_kb_per_seconds_by_interface.asTarget(), + signals.network.network_transmission_rate_kb_per_seconds_by_interface.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('KBs') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // SQL panels + avgSqlExecutionTime: + g.panel.timeSeries.new('Average SQL execution time') + + g.panel.timeSeries.panelOptions.withDescription('Average SQL service elapsed time per execution') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.sql.sql_service_elap_per_exec_avg_ms.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('ms') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + g.panel.timeSeries.thresholdStep.withColor('green') + g.panel.timeSeries.thresholdStep.withValue(null), + g.panel.timeSeries.thresholdStep.withColor('red') + g.panel.timeSeries.thresholdStep.withValue(1000), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + sqlLockTime: + g.panel.timeSeries.new('SQL lock time') + + g.panel.timeSeries.panelOptions.withDescription('SQL service lock time per execution') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.sql.sql_service_lock_per_exec_ms.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('ms') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + sqlTopTimeConsumers: + g.panel.timeSeries.new('SQL top time consumers') + + g.panel.timeSeries.panelOptions.withDescription('Top SQL time consumers') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.sql.sql_top_time_consumers_mu.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('µs') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // Connection panels + totalConnections: + g.panel.stat.new('Total connections') + + g.panel.stat.panelOptions.withDescription('Total count of database connections') + + g.panel.stat.queryOptions.withTargets([ + signals.connections.connections_total_count.asTarget(), + ]) + + g.panel.stat.options.reduceOptions.withCalcs(['lastNotNull']) + + g.panel.stat.options.withGraphMode('area'), + + connectionsByType: + g.panel.timeSeries.new('Connections by type') + + g.panel.timeSeries.panelOptions.withDescription('Database connections by type and status') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.connections.connections_total_count_by_type.asTarget(), + ]) + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // Storage panels + topTableMemory: + g.panel.timeSeries.new('Top table memory') + + g.panel.timeSeries.panelOptions.withDescription('Top table column store memory consumption') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.storage.table_cs_top_mem_total_mb.asTarget(), + ]) + + g.panel.timeSeries.standardOptions.withUnit('decmbytes') + + g.panel.timeSeries.options.tooltip.withMode('multi') + + g.panel.timeSeries.options.tooltip.withSort('desc'), + + // Alert panels + currentAlerts: + g.panel.stat.new('Current alerts') + + g.panel.stat.panelOptions.withDescription('Count of current system alerts') + + g.panel.stat.queryOptions.withTargets([ + signals.alerts.alerts_current_rating.asTarget(), + ]) + + g.panel.stat.options.reduceOptions.withCalcs(['lastNotNull']) + + g.panel.stat.options.withGraphMode('area'), + + alertsDetail: + g.panel.table.new('Alerts detail') + + g.panel.table.panelOptions.withDescription('Detailed current system alerts') + + g.panel.table.queryOptions.withTargets([ + signals.alerts.alerts_current_rating_detail.asTarget() + + g.query.prometheus.withFormat('table') + + g.query.prometheus.withInstant(true), + ]), + }, +} diff --git a/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml b/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml index 7fb6c2218..c27f30800 100644 --- a/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml +++ b/sap-hana-mixin/prometheus_rules_out/prometheus_alerts.yaml @@ -3,25 +3,25 @@ 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 {{$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 for: 5m labels: severity: critical - - alert: SapHanaHighPhysicalMemoryUsage + - alert: SapHanaHighPhysicalMemory 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 {{$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 for: 5m labels: severity: critical - - alert: SapHanaMemAllocLimitBelowRecommendation + - alert: SapHanaMemAllocBelowLimit 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 {{$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 @@ -30,7 +30,7 @@ groups: 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 {{$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 @@ -39,7 +39,7 @@ groups: 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 {{$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) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb) > 80 @@ -48,23 +48,23 @@ groups: 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 {{$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 for: 5m labels: severity: critical - - alert: SapHanaHighReplicationShippingTime + - alert: SapHanaHighReplicationDelay 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 {{$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 for: 5m labels: severity: critical - - alert: SapHanaReplicationStatusError + - alert: SapHanaReplicationError annotations: description: The replication status of replica {{$labels.secondary_site_name}} is ERROR summary: SAP HANA system replication status signifies an error. diff --git a/sap-hana-mixin/rows.libsonnet b/sap-hana-mixin/rows.libsonnet new file mode 100644 index 000000000..3d69757d6 --- /dev/null +++ b/sap-hana-mixin/rows.libsonnet @@ -0,0 +1,97 @@ +local g = import './g.libsonnet'; + +{ + new(this): { + local panels = this.grafana.panels, + + // System overview rows + systemReplication: + g.panel.row.new('System replication') + + g.panel.row.withPanels([ + panels.replicaStatus { gridPos: { h: 6, w: 8, x: 0, y: 0 } }, + panels.averageReplicationShipDelay { gridPos: { h: 6, w: 16, x: 8, y: 0 } }, + ]), + + systemResources: + g.panel.row.new('System resources') + + g.panel.row.withPanels([ + panels.cpuUsage { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.diskUsage { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + panels.physicalMemoryUsage { gridPos: { h: 6, w: 12, x: 0, y: 6 } }, + panels.sapHanaMemoryUsage { gridPos: { h: 6, w: 12, x: 12, y: 6 } }, + panels.memoryAllocationLimit { gridPos: { h: 6, w: 12, x: 0, y: 12 } }, + panels.schemaMemoryUsage { gridPos: { h: 6, w: 12, x: 12, y: 12 } }, + ]), + + systemNetwork: + g.panel.row.new('Network I/O') + + g.panel.row.withPanels([ + panels.networkIOThroughput { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.networkIOThroughputByInterface { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + ]), + + systemDisk: + g.panel.row.new('Disk I/O') + + g.panel.row.withPanels([ + panels.diskIOThroughput { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.diskIOThroughputByDisk { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + ]), + + systemSQL: + g.panel.row.new('SQL performance') + + g.panel.row.withPanels([ + panels.avgSqlExecutionTime { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.sqlLockTime { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + panels.sqlTopTimeConsumers { gridPos: { h: 6, w: 24, x: 0, y: 6 } }, + ]), + + systemConnections: + g.panel.row.new('Connections') + + g.panel.row.withPanels([ + panels.totalConnections { gridPos: { h: 6, w: 8, x: 0, y: 0 } }, + panels.connectionsByType { gridPos: { h: 6, w: 16, x: 8, y: 0 } }, + ]), + + systemStorage: + g.panel.row.new('Storage') + + g.panel.row.withPanels([ + panels.topTableMemory { gridPos: { h: 6, w: 24, x: 0, y: 0 } }, + ]), + + systemAlerts: + g.panel.row.new('System alerts') + + g.panel.row.withPanels([ + panels.currentAlerts { gridPos: { h: 6, w: 8, x: 0, y: 0 } }, + panels.alertsDetail { gridPos: { h: 6, w: 16, x: 8, y: 0 } }, + ]), + + // Instance overview rows (similar structure but may have different panels) + instanceOverview: + g.panel.row.new('Instance overview') + + g.panel.row.withPanels([ + panels.cpuUsage { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.diskUsage { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + ]), + + instanceMemory: + g.panel.row.new('Memory') + + g.panel.row.withPanels([ + panels.physicalMemoryUsage { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.sapHanaMemoryUsage { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + ]), + + instanceNetwork: + g.panel.row.new('Network') + + g.panel.row.withPanels([ + panels.networkIOThroughput { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.networkIOThroughputByInterface { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + ]), + + instanceSQL: + g.panel.row.new('SQL') + + g.panel.row.withPanels([ + panels.avgSqlExecutionTime { gridPos: { h: 6, w: 12, x: 0, y: 0 } }, + panels.sqlLockTime { gridPos: { h: 6, w: 12, x: 12, y: 0 } }, + ]), + }, +} diff --git a/sap-hana-mixin/signals/alerts.libsonnet b/sap-hana-mixin/signals/alerts.libsonnet new file mode 100644 index 000000000..da6bc02b8 --- /dev/null +++ b/sap-hana-mixin/signals/alerts.libsonnet @@ -0,0 +1,40 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + alerts_current_rating: { + name: 'Current alerts rating', + type: 'gauge', + aggLevel: 'none', + description: 'Count of current system alerts.', + unit: 'none', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_alerts_current_rating{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + alerts_current_rating_detail: { + name: 'Current alerts rating detail', + type: 'gauge', + aggLevel: 'none', + description: 'Detailed current system alerts with metadata.', + unit: 'none', + sources: { + prometheus: { + expr: 'hanadb_alerts_current_rating{%(queriesSelector)s}', + legendCustomTemplate: '{{alert_details}} {{alert_useraction}}', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/connections.libsonnet b/sap-hana-mixin/signals/connections.libsonnet new file mode 100644 index 000000000..6323597fb --- /dev/null +++ b/sap-hana-mixin/signals/connections.libsonnet @@ -0,0 +1,40 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + connections_total_count: { + name: 'Total connections count', + type: 'gauge', + aggLevel: 'none', + description: 'Total count of database connections.', + unit: 'none', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_connections_total_count{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + connections_total_count_by_type: { + name: 'Total connections count by type', + type: 'gauge', + aggLevel: 'none', + description: 'Total count of database connections by type and status.', + unit: 'none', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, connection_type, connection_status) (hanadb_connections_total_count{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{connection_type}} - {{connection_status}}', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/cpu.libsonnet b/sap-hana-mixin/signals/cpu.libsonnet new file mode 100644 index 000000000..21e2238ab --- /dev/null +++ b/sap-hana-mixin/signals/cpu.libsonnet @@ -0,0 +1,42 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + cpu_busy_percent: { + name: 'CPU busy percent', + type: 'gauge', + aggLevel: 'none', + description: 'CPU usage percentage of the SAP HANA system.', + unit: 'percent', + sources: { + prometheus: { + expr: 'hanadb_cpu_busy_percent{%(queriesSelector)s}', + legendCustomTemplate: '{{host}} - core {{core}}', + aggKeepLabels: ['host', 'core'], + }, + }, + }, + + cpu_busy_percent_by_host: { + name: 'CPU busy percent by host', + type: 'gauge', + aggLevel: 'none', + aggFunction: 'sum', + description: 'Total CPU usage percentage by host in the SAP HANA system.', + unit: 'percent', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, core) (hanadb_cpu_busy_percent{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - core {{core}}', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/disk.libsonnet b/sap-hana-mixin/signals/disk.libsonnet new file mode 100644 index 000000000..53a89e016 --- /dev/null +++ b/sap-hana-mixin/signals/disk.libsonnet @@ -0,0 +1,81 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + disk_total_used_size_mb: { + name: 'Disk total used size', + type: 'gauge', + aggLevel: 'none', + description: 'Total disk space used in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_disk_total_used_size_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + disk_total_size_mb: { + name: 'Disk total size', + type: 'gauge', + aggLevel: 'none', + description: 'Total disk space in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_disk_total_size_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + disk_usage_percent: { + name: 'Disk usage percent', + type: 'raw', + description: 'Disk space usage as a percentage.', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (job, sid, host) (hanadb_disk_total_used_size_mb{%(queriesSelector)s}) / sum by (job, sid, host) (hanadb_disk_total_size_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + disk_io_throughput_kb_second: { + name: 'Disk I/O throughput', + type: 'gauge', + aggLevel: 'none', + description: 'Disk I/O throughput in KB/s.', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_disk_io_throughput_kb_second{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + disk_io_throughput_kb_second_by_disk: { + name: 'Disk I/O throughput by disk', + type: 'gauge', + aggLevel: 'none', + description: 'Disk I/O throughput by disk device in KB/s.', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, disk) (hanadb_disk_io_throughput_kb_second{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{disk}}', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/memory.libsonnet b/sap-hana-mixin/signals/memory.libsonnet new file mode 100644 index 000000000..b53c4b060 --- /dev/null +++ b/sap-hana-mixin/signals/memory.libsonnet @@ -0,0 +1,170 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + // Physical memory metrics + host_memory_resident_mb: { + name: 'Host memory resident', + type: 'gauge', + aggLevel: 'none', + description: 'Resident memory usage in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_host_memory_resident_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - resident', + }, + }, + }, + + host_memory_physical_total_mb: { + name: 'Host memory physical total', + type: 'gauge', + aggLevel: 'none', + description: 'Total physical memory in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + // Physical memory usage percentage (raw calculation) + physical_memory_usage_percent: { + name: 'Physical memory usage percent', + type: 'raw', + description: 'Current physical memory usage of the host as a percentage.', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (job, sid, host) (hanadb_host_memory_resident_mb{%(queriesSelector)s}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - resident', + }, + }, + }, + + // Swap memory metrics + host_memory_swap_used_mb: { + name: 'Host memory swap used', + type: 'gauge', + aggLevel: 'none', + description: 'Used swap memory in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - swap', + }, + }, + }, + + host_memory_swap_free_mb: { + name: 'Host memory swap free', + type: 'gauge', + aggLevel: 'none', + description: 'Free swap memory in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_host_memory_swap_free_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + // Swap memory usage percentage (raw calculation) + swap_memory_usage_percent: { + name: 'Swap memory usage percent', + type: 'raw', + description: 'Current swap memory usage as a percentage.', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{%(queriesSelector)s}) / (sum by (job, sid, host) (hanadb_host_memory_swap_used_mb{%(queriesSelector)s}) + sum by (job, sid, host) (hanadb_host_memory_swap_free_mb{%(queriesSelector)s}))', + legendCustomTemplate: '{{host}} - swap', + }, + }, + }, + + // SAP HANA memory metrics + host_memory_used_total_mb: { + name: 'Host memory used total', + type: 'gauge', + aggLevel: 'none', + description: 'Total SAP HANA memory used in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_host_memory_used_total_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + host_memory_alloc_limit_mb: { + name: 'Host memory allocation limit', + type: 'gauge', + aggLevel: 'none', + description: 'SAP HANA memory allocation limit in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + // SAP HANA memory usage percentage (raw calculation) + hana_memory_usage_percent: { + name: 'SAP HANA memory usage percent', + type: 'raw', + description: 'Current SAP HANA memory usage as a percentage of allocation limit.', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (job, sid, host) (hanadb_host_memory_used_total_mb{%(queriesSelector)s}) / sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + // Memory allocation limit percentage (raw calculation) + memory_alloc_limit_percent: { + name: 'Memory allocation limit percent', + type: 'raw', + description: 'Memory allocation limit as a percentage of total physical memory.', + unit: 'percent', + sources: { + prometheus: { + expr: '100 * sum by (job, sid, host) (hanadb_host_memory_alloc_limit_mb{%(queriesSelector)s}) / sum by (job, sid, host) (hanadb_host_memory_physical_total_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}}', + }, + }, + }, + + // Schema memory usage + schema_used_memory_mb: { + name: 'Schema used memory', + type: 'gauge', + aggLevel: 'none', + description: 'Memory used by SAP HANA schemas.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, database_name, schema_name) (hanadb_schema_used_memory_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{database_name}} - {{schema_name}}', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/network.libsonnet b/sap-hana-mixin/signals/network.libsonnet new file mode 100644 index 000000000..89abb866b --- /dev/null +++ b/sap-hana-mixin/signals/network.libsonnet @@ -0,0 +1,68 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + network_receive_rate_kb_per_seconds: { + name: 'Network receive rate', + type: 'gauge', + aggLevel: 'none', + description: 'Network receive rate in KB/s.', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_network_receive_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - receive', + }, + }, + }, + + network_receive_rate_kb_per_seconds_by_interface: { + name: 'Network receive rate by interface', + type: 'gauge', + aggLevel: 'none', + description: 'Network receive rate by interface in KB/s.', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, interface) (hanadb_network_receive_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{interface}} - receive', + }, + }, + }, + + network_transmission_rate_kb_per_seconds: { + name: 'Network transmission rate', + type: 'gauge', + aggLevel: 'none', + description: 'Network transmission rate in KB/s.', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (job, sid, host) (hanadb_network_transmission_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - transmit', + }, + }, + }, + + network_transmission_rate_kb_per_seconds_by_interface: { + name: 'Network transmission rate by interface', + type: 'gauge', + aggLevel: 'none', + description: 'Network transmission rate by interface in KB/s.', + unit: 'KBs', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, interface) (hanadb_network_transmission_rate_kb_per_seconds{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{interface}} - transmit', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/replication.libsonnet b/sap-hana-mixin/signals/replication.libsonnet new file mode 100644 index 000000000..7fce66d22 --- /dev/null +++ b/sap-hana-mixin/signals/replication.libsonnet @@ -0,0 +1,41 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'avg', + signals: { + sr_replication: { + name: 'System replication status', + type: 'gauge', + aggLevel: 'none', + description: 'State of the replicas in the SAP HANA system.', + unit: 'none', + sources: { + prometheus: { + expr: 'hanadb_sr_replication{%(queriesSelector)s}', + legendCustomTemplate: '{{secondary_site_name}}', + }, + }, + }, + + sr_ship_delay: { + name: 'System replication ship delay', + type: 'gauge', + aggLevel: 'none', + aggFunction: 'avg', + description: 'Average system replication log shipping delay.', + unit: 's', + sources: { + prometheus: { + expr: 'avg by (job, sid, secondary_site_name) (hanadb_sr_ship_delay{%(queriesSelector)s})', + legendCustomTemplate: '{{secondary_site_name}}', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/sql.libsonnet b/sap-hana-mixin/signals/sql.libsonnet new file mode 100644 index 000000000..780b0fcd2 --- /dev/null +++ b/sap-hana-mixin/signals/sql.libsonnet @@ -0,0 +1,70 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'avg', + signals: { + sql_service_elap_per_exec_avg_ms: { + name: 'SQL service elapsed time per execution', + type: 'gauge', + aggLevel: 'none', + aggFunction: 'avg', + description: 'Average SQL service elapsed time per execution in milliseconds.', + unit: 'ms', + sources: { + prometheus: { + expr: 'avg by (job, sid, host, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - service: {{service}} - type: {{sql_type}}', + }, + }, + }, + + sql_service_elap_per_exec_avg_ms_by_service: { + name: 'SQL service elapsed time per execution by service', + type: 'gauge', + aggLevel: 'none', + aggFunction: 'avg', + description: 'Average SQL service elapsed time per execution by service and type.', + unit: 'ms', + sources: { + prometheus: { + expr: 'avg by (job, sid, host, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{service}} - {{sql_type}}', + }, + }, + }, + + sql_service_lock_per_exec_ms: { + name: 'SQL service lock time per execution', + type: 'gauge', + aggLevel: 'none', + description: 'SQL service lock time per execution in milliseconds.', + unit: 'ms', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, service, sql_type) (hanadb_sql_service_lock_per_exec_ms{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{service}} - {{sql_type}}', + }, + }, + }, + + sql_top_time_consumers_mu: { + name: 'SQL top time consumers', + type: 'gauge', + aggLevel: 'none', + description: 'Top SQL time consumers in microseconds.', + unit: 'µs', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, sql_hash) (hanadb_sql_top_time_consumers_mu{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - hash: {{sql_hash}}', + }, + }, + }, + }, + } diff --git a/sap-hana-mixin/signals/storage.libsonnet b/sap-hana-mixin/signals/storage.libsonnet new file mode 100644 index 000000000..b59d9f477 --- /dev/null +++ b/sap-hana-mixin/signals/storage.libsonnet @@ -0,0 +1,26 @@ +local g = import '../g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', + aggFunction: 'sum', + signals: { + table_cs_top_mem_total_mb: { + name: 'Table column store top memory', + type: 'gauge', + aggLevel: 'none', + description: 'Top table column store memory consumption in MB.', + unit: 'decmbytes', + sources: { + prometheus: { + expr: 'sum by (job, sid, host, database_name, schema_name, table_name) (hanadb_table_cs_top_mem_total_mb{%(queriesSelector)s})', + legendCustomTemplate: '{{host}} - {{database_name}} - {{schema_name}} - {{table_name}}', + }, + }, + }, + }, + }