Skip to content

Commit a1becc6

Browse files
committed
wip SAP HANA mixin modernization
1 parent d9709a2 commit a1becc6

21 files changed

+2480
-4119
lines changed

sap-hana-mixin/alerts.libsonnet

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
{
2+
new(this): {
3+
local config = this.config,
4+
groups: [
5+
{
6+
name: 'sap-hana-alerts',
7+
rules: [
8+
{
9+
alert: 'SapHanaHighCpuUtilization',
10+
expr: |||
11+
sum without (database_name) (hanadb_cpu_busy_percent{%(filteringSelector)s}) > %(alertsCriticalHighCpuUsage)s
12+
||| % config,
13+
'for': '5m',
14+
labels: {
15+
severity: 'critical',
16+
},
17+
annotations: {
18+
summary: 'CPU utilization is high.',
19+
description: (
20+
'The CPU usage is at {{ printf "%%.2f" $value }}%% on {{$labels.core}} on {{$labels.host}} which is above the threshold of %(alertsCriticalHighCpuUsage)s%%.'
21+
) % config,
22+
},
23+
},
24+
{
25+
alert: 'SapHanaHighPhysicalMemoryUsage',
26+
expr: |||
27+
100 * sum without (database_name)(hanadb_host_memory_resident_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) > %(alertsCriticalHighPhysicalMemoryUsage)s
28+
||| % config,
29+
'for': '5m',
30+
labels: {
31+
severity: 'critical',
32+
},
33+
annotations: {
34+
summary: 'Current physical memory usage of the host is approaching capacity.',
35+
description: (
36+
'The physical memory usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighPhysicalMemoryUsage)s%%.'
37+
) % config,
38+
},
39+
},
40+
{
41+
alert: 'SapHanaMemAllocLimitBelowRecommendation',
42+
expr: |||
43+
100 * sum without (database_name) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_physical_total_mb{%(filteringSelector)s}) < %(alertsWarningLowMemAllocLimit)s
44+
||| % config,
45+
'for': '5m',
46+
labels: {
47+
severity: 'warning',
48+
},
49+
annotations: {
50+
summary: 'Memory allocation limit set below recommended limit.',
51+
description: (
52+
'The memory allocation limit is set at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is below the recommended value of %(alertsWarningLowMemAllocLimit)s%%.'
53+
) % config,
54+
},
55+
},
56+
{
57+
alert: 'SapHanaHighMemoryUsage',
58+
expr: |||
59+
100 * sum without (database_name) (hanadb_host_memory_used_total_mb{%(filteringSelector)s}) / sum without (database_name) (hanadb_host_memory_alloc_limit_mb{%(filteringSelector)s}) > %(alertsCriticalHighMemoryUsage)s
60+
||| % config,
61+
'for': '5m',
62+
labels: {
63+
severity: 'critical',
64+
},
65+
annotations: {
66+
summary: 'Current SAP HANA memory usage is approaching capacity.',
67+
description: (
68+
'The memory usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(alertsCriticalHighMemoryUsage)s%%.'
69+
) % config,
70+
},
71+
},
72+
{
73+
alert: 'SapHanaHighDiskUtilization',
74+
expr: |||
75+
100 * sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_used_size_mb{%(filteringSelector)s}) / sum without (database_name, filesystem_type, path, usage_type) (hanadb_disk_total_size_mb{%(filteringSelector)s}) > %(alertsCriticalHighDiskUtilization)s
76+
||| % config,
77+
'for': '5m',
78+
labels: {
79+
severity: 'critical',
80+
},
81+
annotations: {
82+
summary: 'SAP HANA disk is approaching capacity.',
83+
description: (
84+
'The disk usage is at {{ printf "%%.2f" $value }}%% on {{$labels.host}} which is above the threshold of %(filteringSelector)s%%.'
85+
) % config,
86+
},
87+
},
88+
{
89+
alert: 'SapHanaHighSqlExecutionTime',
90+
expr: |||
91+
avg without (database_name, port, service, sql_type) (hanadb_sql_service_elap_per_exec_avg_ms{%(filteringSelector)s}) / 1000 > %(alertsCriticalHighSqlExecutionTime)s
92+
||| % config,
93+
'for': '5m',
94+
labels: {
95+
severity: 'critical',
96+
},
97+
annotations: {
98+
summary: 'SAP HANA SQL average execution time is high.',
99+
description: (
100+
'The average SQL execution time is at {{ printf "%%.2f" $value }}s on {{$labels.host}} which is above the threshold of %(alertsCriticalHighSqlExecutionTime)ss.'
101+
) % config,
102+
},
103+
},
104+
{
105+
alert: 'SapHanaHighReplicationShippingTime',
106+
expr: |||
107+
avg without (database_name, port, secondary_port, replication_mode) (hanadb_sr_ship_delay{%(filteringSelector)s}) > %(alertsCriticalHighReplicationShippingTime)s
108+
||| % config,
109+
'for': '5m',
110+
labels: {
111+
severity: 'critical',
112+
},
113+
annotations: {
114+
summary: 'SAP HANA system replication log shipping delay is high.',
115+
description: (
116+
'The average system replication log shipping delay is at {{ printf "%%.2f" $value }}s from primary site {{$labels.site_name}} to replica site {{$labels.secondary_site_name}} which is above the threshold of %(alertsCriticalHighReplicationShippingTime)ss.'
117+
) % config,
118+
},
119+
},
120+
{
121+
alert: 'SapHanaReplicationStatusError',
122+
expr: |||
123+
hanadb_sr_replication{%(filteringSelector)s} == 4
124+
||| % config,
125+
'for': '5m',
126+
labels: {
127+
severity: 'critical',
128+
},
129+
annotations: {
130+
summary: 'SAP HANA system replication status signifies an error.',
131+
description: 'The replication status of replica {{$labels.secondary_site_name}} is ERROR',
132+
},
133+
},
134+
],
135+
},
136+
],
137+
},
138+
}

sap-hana-mixin/alerts/alerts.libsonnet

Lines changed: 0 additions & 147 deletions
This file was deleted.

sap-hana-mixin/config.libsonnet

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
11
{
2-
_config+:: {
3-
dashboardTags: ['sap-hana-mixin'],
4-
dashboardPeriod: 'now-1h',
5-
dashboardTimezone: 'default',
6-
dashboardRefresh: '1m',
7-
8-
// alerts thresholds
9-
alertsCriticalHighCpuUsage: 80, // percent 0-100
10-
alertsCriticalHighPhysicalMemoryUsage: 80, // percent 0-100
11-
alertsWarningLowMemAllocLimit: 90, // percent 0-100
12-
alertsCriticalHighMemoryUsage: 80, // percent 0-100
13-
alertsCriticalHighDiskUtilization: 80, //percent 0-100
14-
alertsCriticalHighSqlExecutionTime: 1, // second
15-
alertsCriticalHighReplicationShippingTime: 1, //second
16-
17-
enableLokiLogs: true,
2+
local this = self,
3+
4+
// Filtering and label configuration
5+
filteringSelector: 'job="integrations/sap-hana"',
6+
7+
groupLabels: ['job', 'sid'],
8+
instanceLabels: ['host'],
9+
10+
// Dashboard configuration
11+
uid: 'sap-hana',
12+
dashboardNamePrefix: 'SAP HANA',
13+
dashboardTags: ['sap-hana-mixin'],
14+
dashboardPeriod: 'now-1h',
15+
dashboardTimezone: 'default',
16+
dashboardRefresh: '1m',
17+
18+
// Alert thresholds
19+
alertsCriticalHighCpuUsage: 80, // percent 0-100
20+
alertsCriticalHighPhysicalMemoryUsage: 80, // percent 0-100
21+
alertsWarningLowMemAllocLimit: 90, // percent 0-100
22+
alertsCriticalHighMemoryUsage: 80, // percent 0-100
23+
alertsCriticalHighDiskUtilization: 80, // percent 0-100
24+
alertsCriticalHighSqlExecutionTime: 1, // second
25+
alertsCriticalHighReplicationShippingTime: 1, // second
26+
27+
// Loki logs configuration
28+
enableLokiLogs: true,
29+
extraLogLabels: ['level'],
30+
logsVolumeGroupBy: 'level',
31+
showLogsVolume: true,
32+
33+
34+
// Metrics source for signals
35+
metricsSource: 'prometheus',
36+
37+
// Signal definitions
38+
signals: {
39+
system: (import './signals/system.libsonnet')(this),
40+
instance: (import './signals/instance.libsonnet')(this),
41+
performance: (import './signals/performance.libsonnet')(this),
1842
},
1943
}

0 commit comments

Comments
 (0)