49
49
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,foos,horizontalpodautoscalers,ingresses,jobs,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments,verticalpodautoscalers
50
50
` ` `
51
51
52
+ NOTE: The ` group`, `version`, and `kind` common labels are reserved, and will be overwritten by the values from the `groupVersionKind` field.
53
+
52
54
# ## Examples
53
55
54
56
The examples in this section will use the following custom resource :
@@ -115,7 +117,7 @@ spec:
115
117
Produces the metric :
116
118
117
119
` ` ` prometheus
118
- kube_myteam_io_v1_Foo_uptime 43.21
120
+ kube_crd_uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
119
121
` ` `
120
122
121
123
# ### Multiple Metrics/Kitchen Sink
@@ -166,8 +168,8 @@ spec:
166
168
Produces the following metrics :
167
169
168
170
` ` ` prometheus
169
- kube_myteam_io_v1_Foo_active_count{ active="1",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-a"} 1
170
- kube_myteam_io_v1_Foo_active_count{ active="3",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-b"} 3
171
+ kube_crd_active_count{group="myteam.io", kind="Foo", version="v1", active="1",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-a"} 1
172
+ kube_crd_active_count{group="myteam.io", kind="Foo", version="v1", active="3",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-b"} 3
171
173
` ` `
172
174
173
175
# ## Metric types
@@ -202,7 +204,7 @@ spec:
202
204
Produces the metric :
203
205
204
206
` ` ` prometheus
205
- kube_myteam_io_v1_Foo_uptime 43.21
207
+ kube_crd_uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
206
208
` ` `
207
209
208
210
# ### StateSet
@@ -228,15 +230,15 @@ spec:
228
230
list: [Pending, Bar, Baz]
229
231
` ` `
230
232
231
- Metrics of type ` SateSet ` will generate a metric for each value defined in `list` for each resource.
233
+ Metrics of type `StateSet ` will generate a metric for each value defined in `list` for each resource.
232
234
The value will be 1, if the value matches the one in list.
233
235
234
236
Produces the metric :
235
237
236
238
` ` ` prometheus
237
- kube_myteam_io_v1_Foo_status_phase{ phase="Pending"} 1
238
- kube_myteam_io_v1_Foo_status_phase{ phase="Bar"} 0
239
- kube_myteam_io_v1_Foo_status_phase{ phase="Baz"} 0
239
+ kube_crd_status_phase{group="myteam.io", kind="Foo", version="v1", phase="Pending"} 1
240
+ kube_crd_status_phase{group="myteam.io", kind="Foo", version="v1", phase="Bar"} 0
241
+ kube_crd_status_phase{group="myteam.io", kind="Foo", version="v1", phase="Baz"} 0
240
242
` ` `
241
243
242
244
# ### Info
@@ -266,7 +268,7 @@ spec:
266
268
Produces the metric :
267
269
268
270
` ` ` prometheus
269
- kube_myteam_io_v1_Foo_version{ version="v1.2.3"} 1
271
+ kube_crd_version{group="myteam.io", kind="Foo", version="v1", version="v1.2.3"} 1
270
272
` ` `
271
273
272
274
# ## Naming
@@ -288,7 +290,7 @@ spec:
288
290
289
291
Produces :
290
292
` ` ` prometheus
291
- myteam_foos_uptime 43.21
293
+ myteam_foos_uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
292
294
` ` `
293
295
294
296
To omit namespace and/or subsystem altogether, set them to the empty string :
@@ -304,6 +306,11 @@ spec:
304
306
...
305
307
` ` `
306
308
309
+ Produces :
310
+ ` ` ` prometheus
311
+ uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
312
+ ` ` `
313
+
307
314
# ## Logging
308
315
309
316
If a metric path is registered but not found on a custom resource, an error will be logged. For some resources,
0 commit comments