Skip to content

Commit

Permalink
[kube-prometheus-stack] Conditionally support new table panels
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Feb 26, 2024
1 parent b400181 commit 65da433
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 56.9.0
version: 56.9.1
appVersion: v0.71.2
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
6 changes: 3 additions & 3 deletions charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ def new_representer(dumper, data):

replacement_map = {
'var-namespace=$__cell_1': {
'replacement': 'var-namespace=${__data.fields.namespace}',
'replacement': 'var-namespace=`}}{{ if .Values.grafana.sidecar.dashboards.enableNewTablePanelSyntax }}${__data.fields.namespace}{{ else }}$__cell_1{{ end }}{{`',
},
'var-type=$__cell_2': {
'replacement': 'var-type=${__data.fields.workload_type}',
'replacement': 'var-type=`}}{{ if .Values.grafana.sidecar.dashboards.enableNewTablePanelSyntax }}${__data.fields.workload_type}{{ else }}$__cell_2{{ end }}{{`',
},
'=$__cell': {
'replacement': '=${__value.text}',
'replacement': '=`}}{{ if .Values.grafana.sidecar.dashboards.enableNewTablePanelSyntax }}${__value.text}{{ else }}$__cell{{ end }}{{`',
},
}

Expand Down
3 changes: 3 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,9 @@ grafana:
# Allow discovery in all namespaces for dashboards
searchNamespace: ALL

# Support for new table panels (in case, grafana auto migrate the table-old panels to table panels)
enableNewTablePanelSyntax: false

## Annotations for Grafana dashboard configmaps
##
annotations: {}
Expand Down

0 comments on commit 65da433

Please sign in to comment.