Skip to content

Commit dd608ce

Browse files
committed
Adapt sharding-exporter
1 parent 31fc61b commit dd608ce

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

config/monitoring/sharding-exporter/clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rules:
2222
- apiGroups:
2323
- sharding.timebertt.dev
2424
resources:
25-
- clusterrings
25+
- controllerrings
2626
verbs:
2727
- get
2828
- list

config/monitoring/sharding-exporter/config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
labelsFromPath:
1111
namespace: [metadata, namespace]
1212
shard: [metadata, name]
13-
clusterring: [metadata, labels, alpha.sharding.timebertt.dev/clusterring]
13+
controllerring: [metadata, labels, alpha.sharding.timebertt.dev/controllerring]
1414
metrics:
1515
- name: info
1616
help: "Information about a Shard"
@@ -30,36 +30,36 @@ spec:
3030
# The usual leader election leases don't have the state label making the generator log errors.
3131
# Hence, decrease verbosity of such errors to reduce distraction.
3232
errorLogV: 4
33-
# clusterring metrics
34-
- metricNamePrefix: kube_clusterring
33+
# controllerring metrics
34+
- metricNamePrefix: kube_controllerring
3535
groupVersionKind:
3636
group: sharding.timebertt.dev
3737
version: v1alpha1
38-
kind: ClusterRing
38+
kind: ControllerRing
3939
labelsFromPath:
40-
clusterring: [metadata, name]
40+
controllerring: [metadata, name]
4141
uid: [metadata, uid]
4242
metrics:
4343
- name: metadata_generation
44-
help: "The generation of a ClusterRing"
44+
help: "The generation of a ControllerRing"
4545
each:
4646
type: Gauge
4747
gauge:
4848
path: [metadata, generation]
4949
- name: observed_generation
50-
help: "The latest generation observed by the ClusterRing controller"
50+
help: "The latest generation observed by the ControllerRing controller"
5151
each:
5252
type: Gauge
5353
gauge:
5454
path: [status, observedGeneration]
5555
- name: status_shards
56-
help: "The ClusterRing's total number of shards observed by the ClusterRing controller"
56+
help: "The ControllerRing's total number of shards observed by the ControllerRing controller"
5757
each:
5858
type: Gauge
5959
gauge:
6060
path: [status, shards]
6161
- name: status_available_shards
62-
help: "The ClusterRing's number of available shards observed by the ClusterRing controller"
62+
help: "The ControllerRing's number of available shards observed by the ControllerRing controller"
6363
each:
6464
type: Gauge
6565
gauge:

docs/monitoring.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,32 @@ This counter is incremented every time the sharder calculates a new consistent h
3838

3939
## sharding-exporter
4040

41-
The sharding-exporter is an optional component for metrics about the state of `ClusterRings` and shards, see [Install the Sharding Components](installation.md#monitoring-optional).
41+
The sharding-exporter is an optional component for metrics about the state of `ControllerRings` and shards, see [Install the Sharding Components](installation.md#monitoring-optional).
4242

4343
The `sharding-exporter` service exposes metrics via `https` on the `8443` port at the `/metrics` endpoint.
4444
Clients need to authenticate against the endpoint and must be authorized for `get` on the `nonResourceURL` `/metrics`.
4545

46-
### Exposed `ClusterRing` Metrics
46+
### Exposed `ControllerRing` Metrics
4747

48-
#### `kube_clusterring_metadata_generation`
48+
#### `kube_controllerring_metadata_generation`
4949

5050
Type: gauge
51-
Description: The generation of a ClusterRing.
51+
Description: The generation of a ControllerRing.
5252

53-
#### `kube_clusterring_observed_generation`
53+
#### `kube_controllerring_observed_generation`
5454

5555
Type: gauge
56-
Description: The latest generation observed by the ClusterRing controller.
56+
Description: The latest generation observed by the ControllerRing controller.
5757

58-
#### `kube_clusterring_status_shards`
58+
#### `kube_controllerring_status_shards`
5959

6060
Type: gauge
61-
Description: The ClusterRing's total number of shards observed by the ClusterRing controller.
61+
Description: The ControllerRing's total number of shards observed by the ControllerRing controller.
6262

63-
#### `kube_clusterring_status_available_shards`
63+
#### `kube_controllerring_status_available_shards`
6464

6565
Type: gauge
66-
Description: The ClusterRing's number of available shards observed by the ClusterRing controller.
66+
Description: The ControllerRing's number of available shards observed by the ControllerRing controller.
6767

6868
### Exposed Shard Metrics
6969

webhosting-operator/config/monitoring/default/dashboards/sharding.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"uid": "${datasource}"
9999
},
100100
"editorMode": "code",
101-
"expr": "sum(kube_shard_state{clusterring=\"$clusterring\", state=~\"ready|expired|uncertain\"}) or vector(0)",
101+
"expr": "sum(kube_shard_state{controllerring=\"$controllerring\", state=~\"ready|expired|uncertain\"}) or vector(0)",
102102
"hide": false,
103103
"range": true,
104104
"refId": "A"
@@ -165,7 +165,7 @@
165165
"uid": "${datasource}"
166166
},
167167
"editorMode": "code",
168-
"expr": "sum(kube_shard_info{clusterring=\"$clusterring\"}) or vector(0)",
168+
"expr": "sum(kube_shard_info{controllerring=\"$controllerring\"}) or vector(0)",
169169
"range": true,
170170
"refId": "A"
171171
}
@@ -355,7 +355,7 @@
355355
},
356356
"editorMode": "code",
357357
"exemplar": true,
358-
"expr": "sum(kube_shard_state{clusterring=\"$clusterring\"}) by (state)",
358+
"expr": "sum(kube_shard_state{controllerring=\"$controllerring\"}) by (state)",
359359
"hide": false,
360360
"instant": false,
361361
"interval": "",
@@ -433,7 +433,7 @@
433433
},
434434
"editorMode": "code",
435435
"exemplar": false,
436-
"expr": "(sum(kube_shard_state{clusterring=\"$clusterring\",state=\"ready\"}) or vector(0)) / (sum(kube_shard_info{clusterring=\"$clusterring\"}) or vector(0)) * 100",
436+
"expr": "(sum(kube_shard_state{controllerring=\"$controllerring\",state=\"ready\"}) or vector(0)) / (sum(kube_shard_info{controllerring=\"$controllerring\"}) or vector(0)) * 100",
437437
"instant": true,
438438
"range": false,
439439
"refId": "A"
@@ -502,7 +502,7 @@
502502
},
503503
"editorMode": "code",
504504
"exemplar": false,
505-
"expr": "sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\"} or 0*sum(kube_shard_info{clusterring=\"$clusterring\"}) by (shard)) by (shard) / ignoring(shard) group_left sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\"}) or vector(0)",
505+
"expr": "sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\"} or 0*sum(kube_shard_info{controllerring=\"$controllerring\"}) by (shard)) by (shard) / ignoring(shard) group_left sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\"}) or vector(0)",
506506
"instant": true,
507507
"legendFormat": "__auto",
508508
"range": false,
@@ -615,7 +615,7 @@
615615
},
616616
"editorMode": "code",
617617
"exemplar": false,
618-
"expr": "sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\"} or 0*sum(kube_shard_info{clusterring=\"$clusterring\"}) by (shard)) by (shard)",
618+
"expr": "sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\"} or 0*sum(kube_shard_info{controllerring=\"$controllerring\"}) by (shard)) by (shard)",
619619
"instant": false,
620620
"interval": "",
621621
"legendFormat": "{{shard}}",
@@ -717,7 +717,7 @@
717717
},
718718
"editorMode": "code",
719719
"exemplar": true,
720-
"expr": "sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\"} or 0*sum(kube_shard_info{clusterring=\"$clusterring\"}) by (shard)) by (shard) / ignoring(shard) group_left sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\"})",
720+
"expr": "sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\"} or 0*sum(kube_shard_info{controllerring=\"$controllerring\"}) by (shard)) by (shard) / ignoring(shard) group_left sum(namespace_shard:kube_website_shard:sum{namespace=~\"$project\"})",
721721
"format": "time_series",
722722
"instant": false,
723723
"interval": "",
@@ -882,7 +882,7 @@
882882
},
883883
"editorMode": "code",
884884
"exemplar": false,
885-
"expr": "sum(namespace_shard_drain:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\",drain=\"\"} * on(shard) group_left kube_shard_state{clusterring=\"$clusterring\",state=\"ready\"}) or vector(0)",
885+
"expr": "sum(namespace_shard_drain:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\",drain=\"\"} * on(shard) group_left kube_shard_state{controllerring=\"$controllerring\",state=\"ready\"}) or vector(0)",
886886
"instant": false,
887887
"interval": "",
888888
"legendFormat": "Assigned",
@@ -896,7 +896,7 @@
896896
},
897897
"editorMode": "code",
898898
"exemplar": false,
899-
"expr": "sum(namespace_shard_drain:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\",drain=\"\"} * on(shard) group_left max(kube_shard_state{clusterring=\"$clusterring\",state!=\"ready\"}) by (shard)) or vector(0)",
899+
"expr": "sum(namespace_shard_drain:kube_website_shard:sum{namespace=~\"$project\",shard!=\"\",drain=\"\"} * on(shard) group_left max(kube_shard_state{controllerring=\"$controllerring\",state!=\"ready\"}) by (shard)) or vector(0)",
900900
"hide": false,
901901
"instant": false,
902902
"interval": "",
@@ -1475,7 +1475,7 @@
14751475
},
14761476
"editorMode": "code",
14771477
"exemplar": true,
1478-
"expr": "sum(rate(controller_sharding_ring_calculations_total{name=\"$clusterring\"}[$__rate_interval]))",
1478+
"expr": "sum(rate(controller_sharding_ring_calculations_total{name=\"$controllerring\"}[$__rate_interval]))",
14791479
"hide": false,
14801480
"interval": "",
14811481
"legendFormat": "Ring Calculations",
@@ -1524,14 +1524,14 @@
15241524
"type": "prometheus",
15251525
"uid": "${datasource}"
15261526
},
1527-
"definition": "label_values(kube_shard_info,clusterring)",
1527+
"definition": "label_values(kube_shard_info,controllerring)",
15281528
"hide": 0,
15291529
"includeAll": false,
15301530
"multi": false,
1531-
"name": "clusterring",
1531+
"name": "controllerring",
15321532
"options": [],
15331533
"query": {
1534-
"query": "label_values(kube_shard_info,clusterring)",
1534+
"query": "label_values(kube_shard_info,controllerring)",
15351535
"refId": "PrometheusVariableQueryEditor-VariableQuery"
15361536
},
15371537
"refresh": 2,

0 commit comments

Comments
 (0)