Skip to content

Commit

Permalink
only quote the double braces
Browse files Browse the repository at this point in the history
  • Loading branch information
Darryl Weaver committed Oct 6, 2022
1 parent 20b0fa1 commit d844337
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions charts/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ The grafana dashboards include variables to be replaced in Grafana such as:
```

Helm template engine will attempt to interpret these as Helm variables, but we want them passed through without Helm interpreting them.
You can get round this by quoting the variable inside backticks like this:
You can get round this by quoting the variable inside backticks and double curly braces like this:
```
{{`{{kind}}`}}
{{`{{`}}kind{{`}}`}}
```

This can be seen used in the upstream kube-prometheus-stack chart here:
- https://github.com/prometheus-community/helm-charts/blob/92a69db2825845e3032a6834dec21e9ec6a5f557/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/pod-total.yaml#L404

## Source Dashboards

The source of the dashboards, for flux these are located here:
Expand Down
12 changes: 6 additions & 6 deletions charts/prometheus/templates/dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ data:
"exemplar": true,
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)",
"interval": "",
"legendFormat": "{{`{{kind}}`}}",
"legendFormat": "{{`{{`}}kind{{`}}`}}",
"refId": "A"
}
],
Expand Down Expand Up @@ -378,7 +378,7 @@ data:
"exemplar": true,
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)",
"interval": "",
"legendFormat": "{{`{{kind}}`}}",
"legendFormat": "{{`{{`}}kind{{`}}`}}",
"refId": "A"
}
],
Expand Down Expand Up @@ -704,7 +704,7 @@ data:
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)",
"hide": false,
"interval": "",
"legendFormat": "{{`{{kind}}/{{name}}`}}",
"legendFormat": "{{`{{`}}kind{{`}}`}}/{{`{{`}}name{{`}}`}}",
"refId": "B"
}
],
Expand Down Expand Up @@ -804,7 +804,7 @@ data:
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)",
"hide": false,
"interval": "",
"legendFormat": "{{`{{kind}}/{{name}}`}}",
"legendFormat": "{{`{{`}}kind{{`}}`}}/{{`{{`}}name{{`}}`}}",
"refId": "B"
}
],
Expand Down Expand Up @@ -1405,7 +1405,7 @@ data:
{
"expr": "rate(process_cpu_seconds_total{namespace=\"$namespace\",pod=~\".*-controller-.*\"}[1m])",
"interval": "",
"legendFormat": "{{`{{pod}}`}}",
"legendFormat": "{{`{{`}}pod{{`}}`}}",
"refId": "A"
}
],
Expand Down Expand Up @@ -1489,7 +1489,7 @@ data:
"expr": "rate(go_memstats_alloc_bytes_total{namespace=\"$namespace\",pod=~\".*-controller-.*\"}[1m])",
"hide": false,
"interval": "",
"legendFormat": "{{`{{pod}}`}}",
"legendFormat": "{{`{{`}}pod{{`}}`}}",
"refId": "A"
}
],
Expand Down

0 comments on commit d844337

Please sign in to comment.