Skip to content

Commit

Permalink
Allow users to define the metrics collection interval (#38)
Browse files Browse the repository at this point in the history
* Allow users to define the metrics collection interval

* Bump chart and update docs

* Update readme to include metrics

* Validate metricsCollectionInterval value
  • Loading branch information
dimitar-hristov authored Dec 20, 2023
1 parent 02469c5 commit 606524b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/cloudzero-cloudwatch-metrics/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: cloudzero-cloudwatch-metrics
description: A Helm chart to deploy cloudzero-cloudwatch-metrics project
version: 0.0.26
version: 0.0.27
appVersion: "0.0.22"

home: https://cloudzero.github.io/cloudzero-k8s-charts/
Expand Down
1 change: 1 addition & 0 deletions stable/cloudzero-cloudwatch-metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ helm upgrade --install cloudzero-cloudwatch-metrics \
| `nodeSelector` | Node labels for pod assignment | {} |
| `tolerations` | Optional deployment tolerations | {} |
| `annotations` | Optional pod annotations | {} |
| `metricsCollectionInterval` | Metrics collection interval in seconds. It can be set to 5, 10, 15, 30, 45, 60 or 120 | 120 |
8 changes: 7 additions & 1 deletion stable/cloudzero-cloudwatch-metrics/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ data:
"metrics_collected": {
"kubernetes": {
"cluster_name": "{{ .Values.clusterName }}",
"metrics_collection_interval": 120
{{- $allowedIntervals := list 5 10 15 30 45 60 120 }}
{{- $failureMessage := printf "metricsCollectionInterval must be set to one of %s" (join "," $allowedIntervals) }}
{{- if not (has (int .Values.metricsCollectionInterval) $allowedIntervals) }}
{{- fail $failureMessage }}
{{- else }}
"metrics_collection_interval": {{ .Values.metricsCollectionInterval }}
{{- end }}
}
},
"force_flush_interval": 5
Expand Down
2 changes: 2 additions & 0 deletions stable/cloudzero-cloudwatch-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ daemonsetLabels: {}

# For AWS ROSA (OpenShift)
#openshift: true

metricsCollectionInterval: 120

0 comments on commit 606524b

Please sign in to comment.