Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add redis sentinel metrics configuration (#367)
Signed-off-by: Pulak Kanti Bhowmick <pulak@appscode.com>
- Loading branch information
1 parent
1881967
commit e3ec7f6
Showing
1 changed file
with
179 additions
and
0 deletions.
There are no files selected for viewing
179 changes: 179 additions & 0 deletions
179
charts/kubedb-metrics/templates/metricsconfig-kubedb-com-redissentinel.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
apiVersion: metrics.appscode.com/v1alpha1 | ||
kind: MetricsConfiguration | ||
metadata: | ||
name: kubedb-com-redissentinel | ||
spec: | ||
targetRef: | ||
apiVersion: kubedb.com/v1alpha2 | ||
kind: RedisSentinel | ||
metrics: | ||
- name: kubedb_redis_sentinel_created | ||
help: "Unix creation time stamp" | ||
type: gauge | ||
field: | ||
path: .metadata.creationTimestamp | ||
type: DateTime | ||
metricValue: | ||
valueFromPath: .metadata.creationTimestamp | ||
|
||
- name: kubedb_redis_sentinel_replicas | ||
help: "Number of replicas of redis sentinel instance" | ||
type: gauge | ||
params: | ||
- key: obj | ||
valuePath: . | ||
metricValue: | ||
valueFromExpression: resource_replicas(obj) | ||
|
||
- name: kubedb_redis_sentinel_tls_enabled | ||
help: "Redis sentinel tls info" | ||
type: gauge | ||
params: | ||
- key: tls | ||
valuePath: .spec.tls | ||
metricValue: | ||
valueFromExpression: int(tls != 'nil') | ||
|
||
- name: kubedb_redis_sentinel_status_phase | ||
help: "Redis sentinel instance current phase" | ||
type: gauge | ||
field: | ||
path: .status.phase | ||
type: String | ||
params: | ||
- key: phase | ||
valuePath: .status.phase | ||
states: | ||
labelKey: phase | ||
values: | ||
- labelValue: Ready | ||
metricValue: | ||
valueFromExpression: "int(phase == 'Ready')" | ||
- labelValue: Halted | ||
metricValue: | ||
valueFromExpression: "int(phase == 'Halted')" | ||
- labelValue: Provisioning | ||
metricValue: | ||
valueFromExpression: "int(phase == 'Provisioning')" | ||
- labelValue: Critical | ||
metricValue: | ||
valueFromExpression: "int(phase == 'Critical')" | ||
- labelValue: NotReady | ||
metricValue: | ||
valueFromExpression: "int(phase == 'NotReady')" | ||
- labelValue: DataRestoring | ||
metricValue: | ||
valueFromExpression: "int(phase == 'DataRestoring')" | ||
|
||
- name: kubedb_redis_sentinel_info | ||
help: "Redis senitel instance information" | ||
type: gauge | ||
labels: | ||
- key: version | ||
valuePath: .spec.version | ||
- key: storageType | ||
valuePath: .spec.storageType | ||
- key: terminationPolicy | ||
valuePath: .spec.terminationPolicy | ||
metricValue: | ||
value: 1 | ||
|
||
- name: kubedb_redis_sentinel_status_conditions | ||
help: "Redis sentinel instance status condition" | ||
type: gauge | ||
field: | ||
path: .status.conditions | ||
type: Array | ||
labels: | ||
- key: type | ||
valuePath: .status.conditions[*].type | ||
- key: status | ||
valuePath: .status.conditions[*].status | ||
metricValue: | ||
value: 1 | ||
|
||
- name: kubedb_redis_sentinel_resource_request_cpu | ||
help: "Requested CPU by Redis sentinel in core" | ||
type: gauge | ||
labels: | ||
- key: unit | ||
value: core | ||
params: | ||
- key: obj | ||
valuePath: . | ||
- key: resourceType | ||
value: cpu | ||
metricValue: | ||
valueFromExpression: total_resource_requests(obj, resourceType) | ||
|
||
- name: kubedb_redis_sentinel_resource_request_memory | ||
help: "Requested memory by Redis sentinel in byte" | ||
type: gauge | ||
labels: | ||
- key: unit | ||
value: byte | ||
params: | ||
- key: obj | ||
valuePath: . | ||
- key: resourceType | ||
value: memory | ||
metricValue: | ||
valueFromExpression: total_resource_requests(obj, resourceType) | ||
|
||
- name: kubedb_redis_sentinel_resource_request_storage | ||
help: "Requested storage by Redis sentinel in byte" | ||
type: gauge | ||
labels: | ||
- key: unit | ||
value: byte | ||
params: | ||
- key: obj | ||
valuePath: . | ||
- key: resourceType | ||
value: storage | ||
metricValue: | ||
valueFromExpression: total_resource_requests(obj, resourceType) | ||
|
||
- name: kubedb_redis_sentinel_resource_limit_cpu | ||
help: "CPU limit for Redis sentinel in core" | ||
type: gauge | ||
labels: | ||
- key: unit | ||
value: core | ||
params: | ||
- key: obj | ||
valuePath: . | ||
- key: resourceType | ||
value: cpu | ||
metricValue: | ||
valueFromExpression: total_resource_limits(obj, resourceType) | ||
|
||
- name: kubedb_redis_sentinel_resource_limit_memory | ||
help: "Memory limit for Redis sentinel in byte" | ||
type: gauge | ||
labels: | ||
- key: unit | ||
value: byte | ||
params: | ||
- key: obj | ||
valuePath: . | ||
- key: resourceType | ||
value: memory | ||
metricValue: | ||
valueFromExpression: total_resource_limits(obj, resourceType) | ||
|
||
- name: kubedb_redis_sentinel_resource_limit_storage | ||
help: "Storage limit for Redis sentinel in byte" | ||
type: gauge | ||
labels: | ||
- key: unit | ||
value: byte | ||
params: | ||
- key: obj | ||
valuePath: . | ||
- key: resourceType | ||
value: storage | ||
metricValue: | ||
valueFromExpression: total_resource_limits(obj, resourceType) | ||
|
||
|