Skip to content

Commit

Permalink
Merge pull request #3454 from cbos/add_retries_configuration_for_sidecar
Browse files Browse the repository at this point in the history
[grafana] Add configuration options for the number of retries done by the sidecar
  • Loading branch information
zanhsieh authored Nov 29, 2024
2 parents 624f414 + c275ff6 commit 3185a30
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: grafana
version: 8.6.3
version: 8.6.4
appVersion: 11.3.1
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
60 changes: 60 additions & 0 deletions charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.alerts.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.alerts.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.alerts.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.alerts.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.alerts.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.alerts.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.alerts.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -518,6 +530,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: {{ .Values.sidecar.dashboards.watchClientTimeout | quote }}
{{- end }}
{{- if .Values.sidecar.dashboards.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.dashboards.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.dashboards.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.dashboards.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.dashboards.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.dashboards.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -630,6 +654,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.datasources.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.datasources.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.datasources.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.datasources.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.datasources.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.datasources.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.datasources.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -737,6 +773,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.notifiers.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.notifiers.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.notifiers.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.notifiers.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.notifiers.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.notifiers.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.notifiers.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down Expand Up @@ -844,6 +892,18 @@ containers:
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.plugins.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.plugins.maxTotalRetries }}
- name: REQ_RETRY_TOTAL
value: "{{ .Values.sidecar.plugins.maxTotalRetries }}"
{{- end }}
{{- if .Values.sidecar.plugins.maxConnectRetries }}
- name: REQ_RETRY_CONNECT
value: "{{ .Values.sidecar.plugins.maxConnectRetries }}"
{{- end }}
{{- if .Values.sidecar.plugins.maxReadRetries }}
- name: REQ_RETRY_READ
value: "{{ .Values.sidecar.plugins.maxReadRetries }}"
{{- end }}
{{- with .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 6 }}
Expand Down
86 changes: 86 additions & 0 deletions charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,23 @@ sidecar:
# defaults to 66sec (sic!)
# watchClientTimeout: 60
#
# maxTotalRetries: Total number of retries to allow for any http request.
# Takes precedence over other counts. Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry.
# maxTotalRetries: 5
#
# maxConnectRetries: How many connection-related errors to retry on for any http request.
# These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxConnectRetries: 10
#
# maxReadRetries: How many times to retry on read errors for any http request
# These errors are raised after the request was sent to the server, so the request may have side-effects.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxReadRetries: 5
#
# Endpoint to send request to reload alerts
reloadURL: "http://localhost:3000/api/admin/provisioning/alerting/reload"
# Absolute path to shell script to execute after a alert got reloaded
Expand Down Expand Up @@ -1035,6 +1052,24 @@ sidecar:
# If specified, the sidecar will look for annotation with this name to create folder and put graph here.
# You can use this parameter together with `provider.foldersFromFilesStructure`to annotate configmaps and create folder structure.
folderAnnotation: null
#
# maxTotalRetries: Total number of retries to allow for any http request.
# Takes precedence over other counts. Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry.
# maxTotalRetries: 5
#
# maxConnectRetries: How many connection-related errors to retry on for any http request.
# These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxConnectRetries: 10
#
# maxReadRetries: How many times to retry on read errors for any http request
# These errors are raised after the request was sent to the server, so the request may have side-effects.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxReadRetries: 5
#
# Endpoint to send request to reload alerts
reloadURL: "http://localhost:3000/api/admin/provisioning/dashboards/reload"
# Absolute path to shell script to execute after a configmap got reloaded
Expand Down Expand Up @@ -1115,6 +1150,23 @@ sidecar:
# defaults to 66sec (sic!)
# watchClientTimeout: 60
#
# maxTotalRetries: Total number of retries to allow for any http request.
# Takes precedence over other counts. Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry.
# maxTotalRetries: 5
#
# maxConnectRetries: How many connection-related errors to retry on for any http request.
# These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxConnectRetries: 10
#
# maxReadRetries: How many times to retry on read errors for any http request
# These errors are raised after the request was sent to the server, so the request may have side-effects.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxReadRetries: 5
#
# Endpoint to send request to reload datasources
reloadURL: "http://localhost:3000/api/admin/provisioning/datasources/reload"
# Absolute path to shell script to execute after a datasource got reloaded
Expand Down Expand Up @@ -1157,6 +1209,23 @@ sidecar:
# defaults to 66sec (sic!)
# watchClientTimeout: 60
#
# maxTotalRetries: Total number of retries to allow for any http request.
# Takes precedence over other counts. Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry.
# maxTotalRetries: 5
#
# maxConnectRetries: How many connection-related errors to retry on for any http request.
# These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxConnectRetries: 10
#
# maxReadRetries: How many times to retry on read errors for any http request
# These errors are raised after the request was sent to the server, so the request may have side-effects.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxReadRetries: 5
#
# Endpoint to send request to reload plugins
reloadURL: "http://localhost:3000/api/admin/provisioning/plugins/reload"
# Absolute path to shell script to execute after a plugin got reloaded
Expand Down Expand Up @@ -1199,6 +1268,23 @@ sidecar:
# defaults to 66sec (sic!)
# watchClientTimeout: 60
#
# maxTotalRetries: Total number of retries to allow for any http request.
# Takes precedence over other counts. Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry.
# maxTotalRetries: 5
#
# maxConnectRetries: How many connection-related errors to retry on for any http request.
# These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxConnectRetries: 10
#
# maxReadRetries: How many times to retry on read errors for any http request
# These errors are raised after the request was sent to the server, so the request may have side-effects.
# Applies to all requests to reloadURL and k8s api requests.
# Set to 0 to fail on the first retry of this type.
# maxReadRetries: 5
#
# Endpoint to send request to reload notifiers
reloadURL: "http://localhost:3000/api/admin/provisioning/notifications/reload"
# Absolute path to shell script to execute after a notifier got reloaded
Expand Down

0 comments on commit 3185a30

Please sign in to comment.