This repository has been archived by the owner on Dec 8, 2023. It is now read-only.
/
conf.example.yaml
361 lines (326 loc) · 10 KB
/
conf.example.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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# Sample configuration file showing various configuration options
apiVersion: v1
kind: ConfigMap
metadata:
name: collector-config
namespace: wavefront-collector
data:
collector.yaml: |
clusterName: k8s-cluster
enableDiscovery: true
enableEvents: true
flushInterval: 30s
sinks:
- proxyAddress: wavefront-proxy.default.svc.cluster.local:2878
tags:
env: non-production
region: us-west-2
filters:
# Filter out infrequently used kube-state-metrics.
metricDenyList:
- 'kube.configmap.annotations.gauge'
- 'kube.configmap.metadata.resource.version.gauge'
- 'kube.endpoint.*'
- 'kube.job.owner.gauge'
- 'kube.job.labels.gauge'
- 'kube.job.spec.completions.gauge'
- 'kube.job.spec.parallelism.gauge'
- 'kube.job.status.start.time.gauge'
- 'kube.limitrange.*'
- 'kube.namespace.annotations.gauge'
- 'kube.persistentvolume.*'
- 'kube.persistentvolumeclaim.*'
- 'kube.pod.container.resource.limits.*'
- 'kube.pod.container.*.reason.gauge'
- 'kube.pod.owner.gauge'
- 'kube.pod.start.time.gauge'
- 'kube.pod.status.scheduled.gauge'
- 'kube.pod.status.scheduled.time.gauge'
- 'kube.replicationcontroller.created.gauge'
- 'kube.replicationcontroller.metadata.generation.gauge'
- 'kube.replicationcontroller.spec.replicas.gauge'
- 'kube.resourcequota.*'
- 'kube.secret.*'
- 'kube.statefulset.*'
- 'kube.storageclass.*'
# Filter out generated labels
tagExclude:
- 'label?controller?revision*'
- 'label?pod?template*'
- 'annotation_kubectl_kubernetes_io_last_applied_configuration'
events:
filters:
tagWhitelist:
namespace:
- "default"
sources:
kubernetes_source:
url: 'https://kubernetes.default.svc'
kubeletPort: 10250
kubeletHttps: true
useServiceAccount: true
insecure: true
prefix: 'kubernetes.'
filters:
metricDenylist:
- 'kubernetes.sys_container.*'
internal_stats_source:
prefix: 'kubernetes.'
kubernetes_state_source:
prefix: 'kubernetes.'
kubernetes_cadvisor_source:
prefix: 'kubernetes.cadvisor.'
filters:
metricAllowList:
- "kubernetes.cadvisor.container.cpu.cfs.throttled.seconds.total.counter"
- "kubernetes.cadvisor.container.cpu.cfs.throttled.periods.total.counter"
kubernetes_control_plane_source:
collection:
interval: "120s"
telegraf_sources:
# empty list enables all host level telegraf plugins
- plugins: []
# example enabling a subset of host level telegraf plugins
- plugins: [mem,net,netstat]
# example enabling a single telegraf plugin with custom telegraf configuration
- plugins: [disk]
conf: |
mount_points = ["/"]
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
prometheus_sources:
# collect metrics from the Kubernetes API server
- url: 'https://kubernetes.default.svc.cluster.local:443/metrics'
httpConfig:
bearer_token_file: '/var/run/secrets/kubernetes.io/serviceaccount/token'
tls_config:
ca_file: '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
insecure_skip_verify: true
prefix: 'kube.apiserver.'
filters:
metricAllowList:
- 'kube.apiserver.apiserver.*'
- 'kube.apiserver.etcd.*'
- 'kube.apiserver.process.*'
# discovery rules for auto-discovery of pods and services
discovery:
plugins:
##########################################################################
# Workload auto discovery
##########################################################################
# activemq
- name: activemq
type: telegraf/activemq
selectors:
images:
- "*activemq*"
port: 8161
conf: |
server = "${host}"
port = ${port}
username = "admin"
password = "admin"
webadmin = "admin"
# apache httpd
- name: apache
type: telegraf/apache
selectors:
images:
- 'httpd*'
- '*httpd*'
port: 80
conf: |
urls = ["http://${host}:${port}/server-status?auto"]
# consul
- name: consul
type: telegraf/consul
selectors:
images:
- 'consul*'
port: 8500
conf: |
address = "${host}:${port}"
scheme = "http"
# couchbase
- name: couchbase
type: telegraf/couchbase
selectors:
images:
- 'couchbase/server:enterprise-6.0.1'
port: 8091
conf: |
servers = ["http://Administrator:password@${host}:${port}"]
# couchdb
- name: couchdb
type: telegraf/couchdb
selectors:
images:
- '*couchdb*'
port: 5984
conf: |
hosts = ["http://admin:password@${host}:${port}/_node/_local/_stats"]
# elasticsearch
- name: elasticsearch
type: telegraf/elasticsearch
selectors:
images:
- '*elastic*'
port: 9200
conf: |
servers = ["http://${host}:${port}"]
local = false
cluster_health = true
cluster_stats = true
# HAProxy
- name: haproxy
type: telegraf/haproxy
selectors:
images:
- "*haproxy*"
port: 8181
conf: |
servers = ["http://username:password@${host}:${port}/haproxy?stats"]
# memcached
- name: memcached
type: telegraf/memcached
selectors:
images:
- 'memcached:*'
port: 11211
conf: |
servers = ["${host}:${port}"]
# mongodb
- name: mongodb
type: telegraf/mongodb
selectors:
images:
- 'mongo*'
port: 27017
conf: |
servers = ["mongodb://main_admin:abc123@${host}:${port}"]
# mysql
- name: mysql
type: telegraf/mysql
selectors:
images:
- "mysql*"
collection:
interval: "180s"
port: 3306
conf: |
servers = ["root:password@tcp(${host}:${port})/?tls=false"]
perf_events_statements_digest_text_limit = 120
perf_events_statements_limit = 250
perf_events_statements_time_limit = 86400
table_schema_databases = []
gather_process_list = true
gather_table_io_waits = true
gather_table_lock_waits = true
gather_index_io_waits = true
gather_event_waits = true
gather_file_events_stats = true
interval_slow = "30m"
# nginx
- name: nginx
type: telegraf/nginx
selectors:
images:
- 'nginx*'
port: 80
conf: |
urls = ["http://${host}:${port}/metrics"]
# nginx_plus
- name: nginx_plus
type: telegraf/nginx_plus
selectors:
images:
- 'nginxplus*'
conf: |
urls = ["http://${host}/api"]
# rabbitmq
- name: rabbitmq
type: telegraf/rabbitmq
selectors:
images:
- 'rabbitmq:*'
port: 15672
conf: |
url = "http://${host}:${port}"
username = "guest"
password = "guest"
# redis master and slaves
- name: redis
type: telegraf/redis
selectors:
images:
- 'redis:*'
- '*redis*'
port: 6379
scheme: "tcp"
conf: |
servers = ["${server}"]
# riak
- name: riak
type: telegraf/riak
selectors:
images:
- 'riak-kv:*'
- '*riak-kv:*'
port: 8098
conf: |
servers = ["http://${host}:${port}"]
# zookeeper
- name: zookeeper
type: telegraf/zookeeper
selectors:
images:
- '*zookeeper'
port: 2181
conf: |
servers = ["${host}:${port}"]
##########################################################################
# Kubernetes component auto discovery
##########################################################################
# auto-discover kube DNS
- name: kube-dns-discovery
type: prometheus
selectors:
images:
- '*kube-dns/sidecar*'
labels:
k8s-app:
- kube-dns
port: 10054
path: /metrics
scheme: http
prefix: kube.dns.
filters:
metricAllowList:
- 'kube.dns.http.request.duration.microseconds'
- 'kube.dns.http.request.size.bytes'
- 'kube.dns.http.requests.total.counter'
- 'kube.dns.http.response.size.bytes'
- 'kube.dns.kubedns.dnsmasq.*'
- 'kube.dns.process.*'
# auto-discover coredns
- name: coredns-discovery
type: prometheus
selectors:
images:
- '*coredns:*'
labels:
k8s-app:
- kube-dns
port: 9153
path: /metrics
scheme: http
prefix: kube.coredns.
filters:
metricAllowList:
- 'kube.coredns.coredns.cache.*'
- 'kube.coredns.coredns.dns.request.count.total.counter'
- 'kube.coredns.coredns.dns.request.duration.seconds'
- 'kube.coredns.coredns.dns.request.size.bytes'
- 'kube.coredns.coredns.dns.request.type.count.total.counter'
- 'kube.coredns.coredns.dns.response.rcode.count.total.counter'
- 'kube.coredns.coredns.dns.response.size.bytes'
- 'kube.coredns.process.*'