From e718e4665175c79ce5a50a6c8bd49b2bb9188ffe Mon Sep 17 00:00:00 2001 From: venegator Date: Fri, 13 Sep 2024 16:01:59 +0200 Subject: [PATCH] feat(argo-workflows): Add honorLabels parameter to Argo Workflows ServiceMonitor (#2920) * Update workflow-controller-servicemonitor.yaml Signed-off-by: venegator * Update values.yaml Signed-off-by: venegator * Update Chart.yaml Signed-off-by: venegator * Update README.md Signed-off-by: venegator * Update charts/argo-workflows/Chart.yaml Co-authored-by: kiblik <5609770+kiblik@users.noreply.github.com> Signed-off-by: venegator * Update workflow-controller-servicemonitor.yaml Signed-off-by: venegator --------- Signed-off-by: venegator Co-authored-by: kiblik <5609770+kiblik@users.noreply.github.com> --- charts/argo-workflows/Chart.yaml | 4 ++-- charts/argo-workflows/README.md | 1 + .../controller/workflow-controller-servicemonitor.yaml | 2 ++ charts/argo-workflows/values.yaml | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/argo-workflows/Chart.yaml b/charts/argo-workflows/Chart.yaml index 8b242c4fb..30ff622d9 100644 --- a/charts/argo-workflows/Chart.yaml +++ b/charts/argo-workflows/Chart.yaml @@ -3,7 +3,7 @@ appVersion: v3.5.10 name: argo-workflows description: A Helm chart for Argo Workflows type: application -version: 0.42.1 +version: 0.42.2 icon: https://argo-workflows.readthedocs.io/en/stable/assets/logo.png home: https://github.com/argoproj/argo-helm sources: @@ -17,4 +17,4 @@ annotations: url: https://argoproj.github.io/argo-helm/pgp_keys.asc artifacthub.io/changes: | - kind: changed - description: add loadBalancerClass field for Service resources + description: add honorLabels config for ServiceMonitor resource diff --git a/charts/argo-workflows/README.md b/charts/argo-workflows/README.md index deec1649b..43e866778 100644 --- a/charts/argo-workflows/README.md +++ b/charts/argo-workflows/README.md @@ -175,6 +175,7 @@ Fields to note: | controller.logging.level | string | `"info"` | Set the logging level (one of: `debug`, `info`, `warn`, `error`) | | controller.metricsConfig.enabled | bool | `false` | Enables prometheus metrics server | | controller.metricsConfig.headlessService | bool | `false` | Flag to enable headless service | +| controller.metricsConfig.honorLabels | bool | `false` | When true, honorLabels preserves the metric’s labels when they collide with the target’s labels. | | controller.metricsConfig.ignoreErrors | bool | `false` | Flag that instructs prometheus to ignore metric emission errors. | | controller.metricsConfig.metricRelabelings | list | `[]` | ServiceMonitor metric relabel configs to apply to samples before ingestion | | controller.metricsConfig.metricsTTL | string | `""` | How often custom metrics are cleared from memory | diff --git a/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml b/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml index 1695f96db..01844a876 100644 --- a/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml +++ b/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml @@ -24,6 +24,7 @@ spec: metricRelabelings: {{- toYaml . | nindent 8 }} {{- end }} + honorLabels: {{ .Values.controller.metricsConfig.honorLabels }} {{- end }} {{- if .Values.controller.telemetryConfig.enabled }} - port: telemetry @@ -37,6 +38,7 @@ spec: metricRelabelings: {{- toYaml . | nindent 8 }} {{- end }} + honorLabels: {{ .Values.controller.metricsConfig.honorLabels }} {{- end }} {{- with .Values.controller.metricsConfig.targetLabels }} targetLabels: diff --git a/charts/argo-workflows/values.yaml b/charts/argo-workflows/values.yaml index 5c2a674d3..aa6e86b17 100644 --- a/charts/argo-workflows/values.yaml +++ b/charts/argo-workflows/values.yaml @@ -143,6 +143,9 @@ controller: servicePortName: metrics # -- Flag to enable headless service headlessService: false + # -- When true, honorLabels preserves the metric’s labels when they collide with the target’s labels. + ## Ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#honorlabels + honorLabels: false # -- ServiceMonitor relabel configs to apply to samples before scraping ## Ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig relabelings: []