forked from prometheus-community/postgres_exporter
-
Notifications
You must be signed in to change notification settings - Fork 11
/
sybase-short.yaml
144 lines (136 loc) · 4.52 KB
/
sybase-short.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
engines:
query: "SELECT COUNT(*) AS running FROM master.dbo.sysengines"
metrics:
- running:
usage: "GAUGE"
description: "number of Sybase dataserver processes running"
kernel:
# @@timeticks gives microseconds / tick,
# @@cpu_busy is given in ticks
# so @@cpu_busy * @@tickticks / 1000000 gives cpu usage in seconds
query: "SELECT CONVERT(REAL, @@cpu_busy) * (CONVERT(REAL, @@timeticks) / 1000000) cpu_busy_seconds_total,
CONVERT(REAL, @@idle) * (CONVERT(REAL, @@timeticks) / 1000000) cpu_idle_seconds_total,
@@connections connections,
@@pack_received tcp_packets_received_total,
@@pack_sent tcp_packets_sent_total,
@@packet_errors tcp_packet_errors_total,
@@total_read disk_reads_total,
@@total_write disk_writes_total,
@@total_errors disk_errors_total"
metrics:
- cpu_busy_seconds_total:
usage: "COUNTER"
description: "cpu activity"
- cpu_idle_seconds_total:
usage: "COUNTER"
description: "cpu idle"
- connections:
usage: "COUNTER"
description: "connections formed"
- tcp_packets_received_total:
usage: "COUNTER"
description: "TCP packets received"
- tcp_packets_sent_total:
usage: "COUNTER"
description: "TCP packets sent"
- tcp_packet_errors_total:
usage: "COUNTER"
description: "TCP packet errors"
- disk_reads_total:
usage: "COUNTER"
description: "disk reads"
- disk_writes_total:
usage: "COUNTER"
description: "disk writes"
- disk_errors_total:
usage: "COUNTER"
description: "disk errors"
- microseconds_per_tick:
usage: "GAUGE"
description: "number of microseconds per tick"
syslogins:
query: "SELECT name AS dbuser, totcpu, totio FROM master.dbo.syslogins"
metrics:
- dbuser:
usage: "LABEL"
description: "DB username"
- totcpu:
usage: "COUNTER"
description: "cpu usage"
- totio:
usage: "COUNTER"
description: "I/O usage"
spid_count_special_users:
query: "SELECT cmd AS sysproc, 1 AS conns
FROM master.dbo.sysprocesses
WHERE suid = 0"
metrics:
- sysproc:
usage: "LABEL"
description: "system process"
- conns:
usage: "GAUGE"
description: "1 if running"
spid_count_by_status:
query: "SELECT status, count(*) AS conns FROM master.dbo.sysprocesses GROUP BY status"
metrics:
- status:
usage: "LABEL"
description: "Status of connections"
- conns:
usage: "GAUGE"
description: "Count of connections with that status"
spid_count_by_user:
query: "SELECT l.name AS dbuser, count(*) AS conns
FROM master.dbo.sysprocesses p, master.dbo.syslogins l
WHERE p.suid = l.suid
GROUP BY l.name"
metrics:
- dbuser:
usage: "LABEL"
description: "DB username"
- conns:
usage: "GAUGE"
description: "Count of connections for that username"
spid_count_blocked_by_user:
query: "SELECT l.name AS dbuser, count(*) AS conns
FROM master.dbo.sysprocesses p, master.dbo.syslogins l
WHERE p.suid = l.suid AND blocked != 0
GROUP BY l.name"
metrics:
- dbuser:
usage: "LABEL"
description: "DB username"
- conns:
usage: "GAUGE"
description: "Count of blocked connections for that username"
syslogshold:
query: "SELECT d.name AS db_name, l.name AS dbuser,
MAX(datediff(ss, starttime, getdate())) AS held_seconds
FROM master.dbo.syslogshold h, master.dbo.sysdatabases d,
master.dbo.sysprocesses p, master.dbo.syslogins l
WHERE h.dbid=d.dbid AND h.spid = p.spid AND p.suid = l.suid
GROUP BY d.name, l.name"
metrics:
- db_name:
usage: "LABEL"
description: "db affected"
- dbuser:
usage: "LABEL"
description: "db username responsible for hold"
- held_seconds:
usage: "GAUGE"
description: "how many seconds the hold has been outstanding"
config:
query: "SELECT name, value FROM master.dbo.sysconfigures WHERE name IN (
'number of user connections',
'time slice',
'procedure cache percent',
'number of open objects')"
metrics:
- name:
usage: "LABEL"
description: "config option"
- value:
usage: "GAUGE"
description: "config setting"