-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmservicescrape.yaml
215 lines (215 loc) · 5.84 KB
/
vmservicescrape.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
# Scrapes vmagent for its performance metrics
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: last9-vmservicescrape-vmagent-01
labels:
last9: enabled
spec:
endpoints:
- port: http
namespaceSelector:
any: false
matchNames: [ "last9-monitoring" ]
selector:
matchLabels:
app.kubernetes.io/instance: vmagent
app.kubernetes.io/name: vmagent-operator
last9_monitoring_agent: vmagent
last9: enabled
---
# Scrapes kube state metrics for k8s metrics
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: last9-servicescrape-k8s-01
labels:
last9: enabled
spec:
discoveryRole: "endpoints"
jobLabel: job
targetLabels: [ ]
podTargetLabels: [ ]
endpoints:
- port: http
path: /metrics
scheme: http
scrapeTimeout: 45s
metricRelabelConfigs:
- sourceLabels: [ "__address__" ]
targetLabel: addr
relabelConfigs:
- sourceLabels: [ "__address__" ]
regex: .+:(.+)
replacement: $1
targetLabel: addr_port
namespaceSelector:
any: false
matchNames: [ "kube-system" ] # Todo: append namespaces here
selector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
---
# Scrapes cadvisor for container metrics
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: last9-servicescrape-metrics-server-01
labels:
last9: enabled
spec:
namespaceSelector:
any: false
matchNames: [ "kube-system" ] # Todo: append namespaces here
endpoints:
- port: https
scheme: https
scrapeTimeout: 45s
tlsConfig:
insecureSkipVerify: true
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
relabelConfigs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- targetLabel: __address__
replacement: kubernetes.default.svc:443
- sourceLabels: [ __meta_kubernetes_node_name ]
regex: (.+)
targetLabel: __metrics_path__
replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
selector:
matchLabels:
k8s-app: metrics-server
last9: enabled
---
# Todo: Uncomment this if you have custom application enabled svcs running and you want to scrape them
# Scrapes node exporter for node metrics
#apiVersion: operator.victoriametrics.com/v1beta1
#kind: VMServiceScrape
#metadata:
# name: last9-servicescrape-apps-01
# labels:
# last9: enabled
#spec:
# namespaceSelector:
# any: false
# matchNames: [ ] # Todo: Append more namespaces here
# endpoints:
# - port: metrics
# scheme: http
# scrapeTimeout: 45s
# selector:
# matchLabels:
# last9: enabled # Todo: Ensure that your services have this label appended as well.
# app: "" # Todo: Append app name label here
---
# Todo: Uncomment this if you have node exporters svcs running and you want to scrape them
# Scrapes node exporter for node metrics
#apiVersion: operator.victoriametrics.com/v1beta1
#kind: VMServiceScrape
#metadata:
# name: last9-servicescrape-node-exporter-01
# labels:
# last9: enabled
#spec:
# namespaceSelector:
# any: false
# matchNames: [ ] # Todo: Append more namespaces here
# endpoints:
# - port: metrics
# scheme: http
# scrapeTimeout: 45s
# selector:
# matchLabels:
# last9: enabled
# app: prometheus-node-exporter
# release: node-exporter
---
# Todo: Uncomment this if you have rabbitMQ exporters svcs running and you want to scrape them
# Scrapes rabbitMQ exporter for metrics
#apiVersion: operator.victoriametrics.com/v1beta1
#kind: VMServiceScrape
#metadata:
# name: last9-servicescrape-rabbitmq-exporter-01
# labels:
# last9: enabled
#spec:
# namespaceSelector:
# any: false
# matchNames: [ ] # Todo: Append more namespaces here
# endpoints:
# - port: metrics
# scheme: http
# scrapeTimeout: 45s
# selector:
# matchLabels:
# last9: enabled
# app: prometheus-rabbitmq-exporter
# release: rabbitmq-exporter
---
# Todo: Uncomment this if you have kafka exporters svcs running and you want to scrape them
# Scrapes kafka exporter for metrics
#apiVersion: operator.victoriametrics.com/v1beta1
#kind: VMServiceScrape
#metadata:
# name: last9-servicescrape-kafka-exporter-01
# labels:
# last9: enabled
#spec:
# namespaceSelector:
# any: false
# matchNames: [ ] # Todo: Append more namespaces here
# endpoints:
# - port: http
# scheme: http
# scrapeTimeout: 45s
# selector:
# matchLabels:
# last9: enabled
# app: prometheus-kafka-exporter
# release: kafka-exporter
---
# Todo: Uncomment this if you have redis exporters svcs running and you want to scrape them
# Scrapes redis exporter for metrics
#apiVersion: operator.victoriametrics.com/v1beta1
#kind: VMServiceScrape
#metadata:
# name: last9-servicescrape-redis-exporter-01
# labels:
# last9: enabled
#spec:
# namespaceSelector:
# any: false
# matchNames: [ ] # Todo: Append more namespaces here
# endpoints:
# - port: redis-exporter
# scheme: http
# scrapeTimeout: 45s
# selector:
# matchLabels:
# last9: enabled
# app: prometheus-redis-exporter
# release: redis-exporter
---
# Todo: Uncomment this if you have pushgateway svcs running and you want to scrape them
# Scrapes pushgateway for metrics
#apiVersion: operator.victoriametrics.com/v1beta1
#kind: VMServiceScrape
#metadata:
# name: last9-servicescrape-pushgateway-01
# labels:
# last9: enabled
#spec:
# namespaceSelector:
# any: false
# matchNames: [ ] # Todo: Append more namespaces here
# endpoints:
# - port: http
# scheme: http
# scrapeTimeout: 45s
# selector:
# matchLabels:
# last9: enabled
# app: prometheus-pushgateway
# release: prometheus-pushgateway