Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RabbitMQ metrics configuration #851

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: metrics.appscode.com/v1alpha1
kind: MetricsConfiguration
metadata:
name: catalog-kubedb-com-rabbitmqversion
spec:
targetRef:
apiVersion: catalog.kubedb.com/v1alpha1
kind: RabbitMQVersion
metrics:
- name: created
help: "Unix creation timestamp"
type: gauge
field:
path: .metadata.creationTimestamp
type: DateTime
metricValue:
valueFromPath: .metadata.creationTimestamp

- name: info
help: "RabbitMQ versions info"
type: gauge
labels:
- key: db_image
valuePath: .spec.db.image
- key: deprecated
valuePath: .spec.deprecated
metricValue:
value: 1
176 changes: 176 additions & 0 deletions charts/kubedb-metrics/templates/rabbitmq/kubedb-com-rabbitmq.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
apiVersion: metrics.appscode.com/v1alpha1
kind: MetricsConfiguration
metadata:
name: kubedb-com-rabbitmq
spec:
targetRef:
apiVersion: kubedb.com/v1alpha2
kind: RabbitMQ
commonLabels:
- key: app
valuePath: .metadata.name
- key: app_namespace
valuePath: .metadata.namespace
metrics:
- name: created
help: "Unix creation timestamp"
type: gauge
field:
path: .metadata.creationTimestamp
type: DateTime
metricValue:
valueFromPath: .metadata.creationTimestamp

- name: status_phase
help: "RabbitMQ 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: info
help: "RabbitMQ instance information"
type: gauge
labels:
- key: storageType
valuePath: .spec.storageType
- key: terminationPolicy
valuePath: .spec.terminationPolicy
- key: version
valuePath: .spec.version
metricValue:
value: 1

- name: status_conditions
help: "RabbitMQ 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: resource_request_cpu
help: "Requested CPU by RabbitMQ 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: resource_request_memory
help: "Requested memory by RabbitMQ 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: resource_request_storage
help: "Requested storage by RabbitMQ 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: resource_limit_cpu
help: "CPU limit for RabbitMQ 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: resource_limit_memory
help: "Memory limit for RabbitMQ 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: resource_limit_storage
help: "Storage limit for RabbitMQ in byte"
type: gauge
labels:
- key: unit
value: byte
params:
- key: obj
valuePath: .
- key: resourceType
value: storage
metricValue:
valueFromExpression: total_resource_limits(obj, resourceType)

- name: replicas
help: "Number of replicas in the RabbitMQ replicaset"
type: gauge
field:
path: .spec.replicas
type: Integer
metricValue:
valueFromPath: .spec.replicas



Loading