From 8f24f6624302550c63cff40c5066d9674b3448bc Mon Sep 17 00:00:00 2001 From: Breee Date: Thu, 12 Dec 2024 09:41:23 +0100 Subject: [PATCH 1/3] feat(kubelet): Add trackTimestampsStaleness Signed-off-by: Breee --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/exporters/kubelet/servicemonitor.yaml | 5 +++++ charts/kube-prometheus-stack/values.yaml | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 56949182aacf..d1fee11da007 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 66.3.1 +version: 66.4.1 appVersion: v0.78.2 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml index d0443c3343c0..842ebf6d15ba 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml @@ -62,6 +62,7 @@ spec: {{- end }} honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }} honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }} + trackTimestampsStaleness: {{ .Values.kubelet.serviceMonitor.trackTimestampsStaleness }} tlsConfig: caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt insecureSkipVerify: true @@ -118,6 +119,7 @@ spec: {{- end }} honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }} honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }} + trackTimestampsStaleness: {{ .Values.kubelet.serviceMonitor.trackTimestampsStaleness }} tlsConfig: caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt insecureSkipVerify: true @@ -144,6 +146,7 @@ spec: {{- end }} honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }} honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }} + trackTimestampsStaleness: {{ .Values.kubelet.serviceMonitor.trackTimestampsStaleness }} {{- if .Values.kubelet.serviceMonitor.metricRelabelings }} metricRelabelings: {{ tpl (toYaml .Values.kubelet.serviceMonitor.metricRelabelings | indent 4) . }} @@ -166,6 +169,7 @@ spec: {{- end }} honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }} honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }} + trackTimestampsStaleness: {{ .Values.kubelet.serviceMonitor.trackTimestampsStaleness }} {{- if .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings }} metricRelabelings: {{ tpl (toYaml .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings | indent 4) . }} @@ -211,6 +215,7 @@ spec: {{- end }} honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }} honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }} + trackTimestampsStaleness: {{ .Values.kubelet.serviceMonitor.trackTimestampsStaleness }} {{- if .Values.kubelet.serviceMonitor.resourceMetricRelabelings }} metricRelabelings: {{ tpl (toYaml .Values.kubelet.serviceMonitor.resourceMetricRelabelings | indent 4) . }} diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index fc06729e6673..5cdea90f5423 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -1322,6 +1322,11 @@ kubelet: ## honorTimestamps: true + ## If true, defines whether Prometheus tracks staleness of the metrics that have an explicit timestamp present in scraped data. Has no effect if `honorTimestamps` is false. + ## We recommend enabling this if you want the best possible accuracy for container_ metrics scraped from cadvisor. + ## + trackTimestampsStaleness: true + ## SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. ## sampleLimit: 0 From 4396baece9d92644ce1e639dcf6ab78432495951 Mon Sep 17 00:00:00 2001 From: Quentin Bisson Date: Thu, 12 Dec 2024 10:00:20 +0100 Subject: [PATCH 2/3] Update charts/kube-prometheus-stack/values.yaml Signed-off-by: Quentin Bisson --- charts/kube-prometheus-stack/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 5cdea90f5423..a146563b1596 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -1322,7 +1322,7 @@ kubelet: ## honorTimestamps: true - ## If true, defines whether Prometheus tracks staleness of the metrics that have an explicit timestamp present in scraped data. Has no effect if `honorTimestamps` is false. + ## If true, defines whether Prometheus tracks staleness of the metrics that have an explicit timestamp present in scraped data. Has no effect if `honorTimestamps` is false. ## We recommend enabling this if you want the best possible accuracy for container_ metrics scraped from cadvisor. ## trackTimestampsStaleness: true From 54f15a60c61142e97442229a26a8688aa49d2e05 Mon Sep 17 00:00:00 2001 From: Quentin Bisson Date: Thu, 12 Dec 2024 10:00:44 +0100 Subject: [PATCH 3/3] Update charts/kube-prometheus-stack/Chart.yaml Signed-off-by: Quentin Bisson --- charts/kube-prometheus-stack/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index d1fee11da007..90024fc4502e 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 66.4.1 +version: 66.4.0 appVersion: v0.78.2 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus