Skip to content

Commit 7f906e8

Browse files
committed
fixup! Represent GVK information as labels
1 parent 633cbf4 commit 7f906e8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

docs/customresourcestate-metrics.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ spec:
116116
Produces the metric:
117117

118118
```prometheus
119-
uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
119+
kube_uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
120120
```
121121

122122
#### Multiple Metrics/Kitchen Sink
@@ -167,8 +167,8 @@ spec:
167167
Produces the following metrics:
168168

169169
```prometheus
170-
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
171-
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
170+
kube_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
171+
kube_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
172172
```
173173

174174
### Metric types
@@ -203,7 +203,7 @@ spec:
203203
Produces the metric:
204204

205205
```prometheus
206-
uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
206+
kube_uptime{group="myteam.io", kind="Foo", version="v1"} 43.21
207207
```
208208

209209
#### StateSet
@@ -235,9 +235,9 @@ The value will be 1, if the value matches the one in list.
235235
Produces the metric:
236236

237237
```prometheus
238-
status_phase{group="myteam.io", kind="Foo", version="v1", phase="Pending"} 1
239-
status_phase{group="myteam.io", kind="Foo", version="v1", phase="Bar"} 0
240-
status_phase{group="myteam.io", kind="Foo", version="v1", phase="Baz"} 0
238+
kube_status_phase{group="myteam.io", kind="Foo", version="v1", phase="Pending"} 1
239+
kube_status_phase{group="myteam.io", kind="Foo", version="v1", phase="Bar"} 0
240+
kube_status_phase{group="myteam.io", kind="Foo", version="v1", phase="Baz"} 0
241241
```
242242

243243
#### Info
@@ -267,7 +267,7 @@ spec:
267267
Produces the metric:
268268

269269
```prometheus
270-
version{group="myteam.io", kind="Foo", version="v1", version="v1.2.3"} 1
270+
kube_version{group="myteam.io", kind="Foo", version="v1", version="v1.2.3"} 1
271271
```
272272

273273
### Naming

pkg/customresourcestate/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type Resource struct {
6464
func (r Resource) GetMetricNamePrefix() string {
6565
p := r.MetricNamePrefix
6666
if p == nil {
67-
return ""
67+
return "kube"
6868
}
6969
return *p
7070
}

pkg/customresourcestate/registry_factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ func Test_fullName(t *testing.T) {
324324
resource: r(nil),
325325
f: count,
326326
},
327-
want: "count",
327+
want: "kube_count",
328328
},
329329
{
330330
name: "no prefix",

0 commit comments

Comments
 (0)