From 9a2db9db2d3a2094e2a0f7634f329885c487e010 Mon Sep 17 00:00:00 2001 From: Marian Soltys <41568766+maso7@users.noreply.github.com> Date: Tue, 23 May 2023 10:27:05 +0200 Subject: [PATCH] feat: add metricRelabelings option for service monitor --- charts/ec2-price-exporter/Chart.yaml | 4 ++-- charts/ec2-price-exporter/templates/servicemonitor.yaml | 4 ++++ charts/ec2-price-exporter/values.yaml | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/charts/ec2-price-exporter/Chart.yaml b/charts/ec2-price-exporter/Chart.yaml index 16bc684..5343735 100644 --- a/charts/ec2-price-exporter/Chart.yaml +++ b/charts/ec2-price-exporter/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: ec2-price-exporter description: Prometheus exporter for spot and on-demand instance prices type: application -version: 0.1.0 -appVersion: "0.2.0" +version: 0.2.0 +appVersion: "0.2.2" sources: - https://github.com/pixelfederation/ec2-price-exporter - https://github.com/AndreZiviani/ec2-price-exporter diff --git a/charts/ec2-price-exporter/templates/servicemonitor.yaml b/charts/ec2-price-exporter/templates/servicemonitor.yaml index cf3d295..1614d4d 100644 --- a/charts/ec2-price-exporter/templates/servicemonitor.yaml +++ b/charts/ec2-price-exporter/templates/servicemonitor.yaml @@ -9,6 +9,10 @@ spec: endpoints: - targetPort: {{ .Values.service.port }} path: {{ .Values.serviceMonitor.metricsPath }} + {{- with .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: + {{ toYaml . | nindent 8 }} + {{- end }} jobLabel: {{ include "ec2-price-exporter.fullname" . }} namespaceSelector: matchNames: diff --git a/charts/ec2-price-exporter/values.yaml b/charts/ec2-price-exporter/values.yaml index cc69e2f..02c3d41 100644 --- a/charts/ec2-price-exporter/values.yaml +++ b/charts/ec2-price-exporter/values.yaml @@ -7,7 +7,7 @@ image: repository: ghcr.io/pixelfederation/ec2-price-exporter pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "v0.2.0" + tag: "v0.2.2" imagePullSecrets: [] nameOverride: "" @@ -78,6 +78,7 @@ serviceMonitor: enabled: false metricsPath: "/metrics" interval: 60s + metricRelabelings: [] nodeSelector: {}