Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-json-exporter]: Allow additional container args and service monitor relabelings #4408

Merged
merged 5 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/prometheus-json-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.11.1
version: 0.12.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
9 changes: 8 additions & 1 deletion charts/prometheus-json-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,17 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.extraInitContainers }}
initContainers:
{{ toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- with .Values.extraArgs }}
args:
{{- range . }}
- {{ .name | quote }}
- {{ .value | quote }}
faisal-khalique marked this conversation as resolved.
Show resolved Hide resolved
{{- end }}
{{- end }}
{{- with .Values.environmentVariables }}
env:
{{- toYaml . | nindent 12}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ spec:
replacement: {{ $replacement }}
action: replace
{{- end }}
{{- with .additionalRelabels | default $.Values.serviceMonitor.defaults.additionalRelabels }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
jobLabel: "{{ $.Release.Name }}"
selector:
matchLabels:
Expand Down
7 changes: 7 additions & 0 deletions charts/prometheus-json-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ serviceMonitor:
# Default values that will be used for all ServiceMonitors created by `targets`
defaults:
additionalMetricsRelabels: {}
additionalRelabels: []
interval: 10s
labels: {}
scrapeTimeout: 30s
Expand All @@ -73,6 +74,7 @@ serviceMonitor:
# interval: 60s # Scraping interval. Overrides value set in `defaults`
# scrapeTimeout: 60s # Scrape timeout. Overrides value set in `defaults`
# additionalMetricsRelabels: {} # Map of metric labels and values to add
# additionalRelabels: [] # relabelings of metrics
# module: example_module # Name of the module to pick up from `config.yaml` for scraping this target. Optional. Default is `default` provided by the exporter itself.

ingress:
Expand Down Expand Up @@ -203,3 +205,8 @@ extraInitContainers: []
# - name: init-myservice
# image: busybox:1.28
# command: [ 'sh', '-c', "sleep 10; done" ]

## Additional container arguments
extraArgs: []
# - name: --config.file
# value: /app/config/myconfig.yml