forked from datastax/metric-collector-for-apache-cassandra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prometheus.yaml
275 lines (272 loc) · 9.75 KB
/
prometheus.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
scrape_configs:
- job_name: prometheus
scrape_interval: 15s
scrape_timeout: 15s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090
- job_name: "mcac"
scrape_interval: 15s
scrape_timeout: 15s
honor_labels: true
file_sd_configs:
- files:
- 'tg_mcac.json'
metric_relabel_configs:
#drop metrics we can calculate from prometheus directly
- source_labels: [__name__]
regex: .*rate_(mean|1m|5m|15m)
action: drop
#save the original name for all metrics
- source_labels: [__name__]
regex: (collectd_mcac_.+)
target_label: prom_name
replacement: ${1}
- source_labels: ["prom_name"]
regex: .+_bucket_(\d+)
target_label: le
replacement: ${1}
- source_labels: ["prom_name"]
regex: .+_bucket_inf
target_label: le
replacement: +Inf
- source_labels: ["prom_name"]
regex: .*_histogram_p(\d+)
target_label: quantile
replacement: .${1}
- source_labels: ["prom_name"]
regex: .*_histogram_min
target_label: quantile
replacement: "0"
- source_labels: ["prom_name"]
regex: .*_histogram_max
target_label: quantile
replacement: "1"
#Table Metrics *ALL* we can drop
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.table\.(\w+)
action: drop
#Table Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.table\.(\w+)\.(\w+)\.(\w+)
target_label: table
replacement: ${3}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.table\.(\w+)\.(\w+)\.(\w+)
target_label: keyspace
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.table\.(\w+)\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_table_${1}
#Keyspace Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.keyspace\.(\w+)\.(\w+)
target_label: keyspace
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.keyspace\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_keyspace_${1}
#ThreadPool Metrics (one type is repair.task so we just ignore the second part)
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.thread_pools\.(\w+)\.(\w+)\.(\w+).*
target_label: pool_type
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.thread_pools\.(\w+)\.(\w+)\.(\w+).*
target_label: pool_name
replacement: ${3}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.thread_pools\.(\w+)\.(\w+)\.(\w+).*
target_label: __name__
replacement: mcac_thread_pools_${1}
#ClientRequest Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.client_request\.(\w+)\.(\w+)$
target_label: request_type
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.client_request\.(\w+)\.(\w+)$
target_label: __name__
replacement: mcac_client_request_${1}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.client_request\.(\w+)\.(\w+)\.(\w+)$
target_label: cl
replacement: ${3}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.client_request\.(\w+)\.(\w+)\.(\w+)$
target_label: request_type
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.client_request\.(\w+)\.(\w+)\.(\w+)$
target_label: __name__
replacement: mcac_client_request_${1}_cl
#Cache Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.cache\.(\w+)\.(\w+)
target_label: cache_name
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.cache\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_cache_${1}
#CQL Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.cql\.(\w+)
target_label: __name__
replacement: mcac_cql_${1}
#Dropped Message Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.dropped_message\.(\w+)\.(\w+)
target_label: message_type
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.dropped_message\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_dropped_message_${1}
#Streaming Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.streaming\.(\w+)\.(.+)$
target_label: peer_ip
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.streaming\.(\w+)\.(.+)$
target_label: __name__
replacement: mcac_streaming_${1}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.streaming\.(\w+)$
target_label: __name__
replacement: mcac_streaming_${1}
#CommitLog Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.commit_log\.(\w+)
target_label: __name__
replacement: mcac_commit_log_${1}
#Compaction Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.compaction\.(\w+)
target_label: __name__
replacement: mcac_compaction_${1}
#Storage Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.storage\.(\w+)
target_label: __name__
replacement: mcac_storage_${1}
#Batch Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.batch\.(\w+)
target_label: __name__
replacement: mcac_batch_${1}
#Client Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.client\.(\w+)
target_label: __name__
replacement: mcac_client_${1}
#BufferPool Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.buffer_pool\.(\w+)
target_label: __name__
replacement: mcac_buffer_pool_${1}
#Index Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.index\.(\w+)
target_label: __name__
replacement: mcac_sstable_index_${1}
#HintService Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.hinted_hand_off_manager\.([^\-]+)-(\w+)
target_label: peer_ip
replacement: ${2}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.hinted_hand_off_manager\.([^\-]+)-(\w+)
target_label: __name__
replacement: mcac_hints_${1}
#HintService Metrics
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.hints_service\.hints_delays\-(\w+)
target_label: peer_ip
replacement: ${1}
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.hints_service\.hints_delays\-(\w+)
target_label: __name__
replacement: mcac_hints_hints_delays
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.hints_service\.([^\-]+)
target_label: __name__
replacement: mcac_hints_${1}
# Misc
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.memtable_pool\.(\w+)
target_label: __name__
replacement: mcac_memtable_pool_${1}
- source_labels: ["mcac"]
regex: com\.datastax\.bdp\.type\.performance_objects\.name\.cql_slow_log\.metrics\.queries_latency
target_label: __name__
replacement: mcac_cql_slow_log_query_latency
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.read_coordination\.(.*)
target_label: read_type
replacement: $1
- source_labels: ["mcac"]
regex: org\.apache\.cassandra\.metrics\.read_coordination\.(.*)
target_label: __name__
replacement: mcac_read_coordination_requests
#GC Metrics
- source_labels: ["mcac"]
regex: jvm\.gc\.(\w+)\.(\w+)
target_label: collector_type
replacement: ${1}
- source_labels: ["mcac"]
regex: jvm\.gc\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_jvm_gc_${2}
#JVM Metrics
- source_labels: ["mcac"]
regex: jvm\.memory\.(\w+)\.(\w+)
target_label: memory_type
replacement: ${1}
- source_labels: ["mcac"]
regex: jvm\.memory\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_jvm_memory_${2}
- source_labels: ["mcac"]
regex: jvm\.memory\.pools\.(\w+)\.(\w+)
target_label: pool_name
replacement: ${2}
- source_labels: ["mcac"]
regex: jvm\.memory\.pools\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_jvm_memory_pool_${2}
- source_labels: ["mcac"]
regex: jvm\.fd\.usage
target_label: __name__
replacement: mcac_jvm_fd_usage
- source_labels: ["mcac"]
regex: jvm\.buffers\.(\w+)\.(\w+)
target_label: buffer_type
replacement: ${1}
- source_labels: ["mcac"]
regex: jvm\.buffers\.(\w+)\.(\w+)
target_label: __name__
replacement: mcac_jvm_buffer_${2}
#Append the prom types back to formatted names
- source_labels: [__name__, "prom_name"]
regex: (mcac_.*);.*(_micros_bucket|_bucket|_micros_count_total|_count_total|_total|_micros_sum|_sum|_stddev).*
separator: ;
target_label: __name__
replacement: ${1}${2}
- regex: prom_name
action: labeldrop