Skip to content

Commit

Permalink
feat(cnpg-monitoring): added cnpg-monitoring helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Tassatux committed Aug 1, 2024
1 parent ab3a114 commit 913baa8
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/cnpg-monitoring/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/cnpg-monitoring/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: kube-state-metrics
repository: https://prometheus-community.github.io/helm-charts
version: 5.25.1
digest: sha256:44ef0e594a43e89ac37d87b317983705a7318e177bc1c97ce11e8bfcb9322e54
generated: "2024-08-01T10:01:05.918725051+02:00"
9 changes: 9 additions & 0 deletions charts/cnpg-monitoring/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: cnpg-monitoring
description: A kube-state-metrics to generate and expose CNPG resources metrics
type: application
version: 0.1.0
dependencies:
- name: kube-state-metrics
version: "5.25.*"
repository: https://prometheus-community.github.io/helm-charts
101 changes: 101 additions & 0 deletions charts/cnpg-monitoring/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
kube-state-metrics:
prometheus:
monitor:
enabled: true
jobLabel: "app.kubernetes.io/instance"
collectors: [ ]
extraArgs:
- --custom-resource-state-only=true
rbac:
extraRules:
- apiGroups:
- postgresql.cnpg.io
resources:
- clusters
- poolers
- scheduledbackups
verbs: [ "list", "watch" ]

customResourceState:
enabled: true
config:
spec:
resources:
- groupVersionKind:
group: postgresql.cnpg.io
version: v1
kind: Cluster
metricNamePrefix: cnpg_resource_cluster
metrics:
- name: info
help: Information about CNPG Cluster
each:
type: Info
info:
labelsFromPath:
cnpg_commit_hash: [status, cloudNativePGCommitHash]
primary_update_method: [spec, primaryUpdateMethod]
primary_update_strategy: [spec, primaryUpdateStrategy]
- name: condition
help: The condition of a CNPG Cluster
each:
type: Gauge
gauge:
path: [status, conditions]
labelsFromPath:
type: [type]
reason: [reason]
valueFrom: [status]
- name: spec_instances
help: Number of desired instances for a CNPG Cluster
each:
type: Gauge
gauge:
path: [spec, instances]
- name: status_instances
help: Number of instances per CNPG Cluster
each:
type: Gauge
gauge:
path: [status, instances]
- name: status_ready_instances
help: Number of ready instances per CNPG Cluster
each:
type: Gauge
gauge:
path: [status, readyInstances]
labelsFromPath:
name: [metadata, name]
namespace: [metadata, namespace]
cnpg_cluster: [metadata, name]
- groupVersionKind:
group: postgresql.cnpg.io
version: v1
kind: Pooler
metricNamePrefix: cnpg_resource_pooler
metrics:
- name: info
help: Information about CNPG Pooler
each:
type: Info
info:
labelsFromPath:
type: [spec, type]
paused: [spec, pgbouncer, paused]
pool_mode: [spec, pgbouncer, poolMode]
- name: spec_instances
help: Number of desired instances for a CNPG Pooler
each:
type: Gauge
gauge:
path: [spec, instances]
- name: status_instances
help: Number of instances per CNPG Pooler
each:
type: Gauge
gauge:
path: [status, instances]
labelsFromPath:
name: [metadata, name]
namespace: [metadata, namespace]
cnpg_cluster: [spec, cluster, name]

0 comments on commit 913baa8

Please sign in to comment.