File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,14 @@ promtool query instant http://127.0.0.1:8001/api/v1/namespaces/default/services/
249
249
250
250
# 1) Download dashboard
251
251
curl -Ls http://127.0.0.1:8001/api/v1/namespaces/default/pods/$podname/proxy/dashboard/prometheus -o pcm-dashboard.json
252
- sed -i 's/4s/2m/' pcm-dashboard.json
252
+
253
+ # change default (too small) interval (from 4s to 2m, following Prometheus best practicies of rate being four times larger than scrapping 30s)
254
+ # References:
255
+ # https://grafana.com/blog/2020/09/28/new-in-grafana-7.2-__rate_interval-for-prometheus-rate-queries-that-just-work/
256
+ # ($__rate_interval is 4 x scrape interval defined in datasource provisioned by prometheus operator, scrape internval is based on Prometheus object which defaults to 30s)
257
+ # - https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L1069
258
+ # - https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L3381
259
+ sed -i 's/4s/$__rate_interval/g' pcm-dashboard.json
253
260
254
261
# 2) port forward with kubectl (--address=0.0.0.0)
255
262
kubectl port-forward -n default service/prometheus-grafana 8002:80
@@ -258,9 +265,9 @@ kubectl port-forward -n default service/prometheus-grafana 8002:80
258
265
# or get password kubectl get secret --namespace default prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
259
266
http://127.0.0.1:8002
260
267
261
- # 4) Go to Dashboards/New/Import
268
+ # 4) Go to Dashboards/New/Import and upload:
269
+
262
270
pcm-dashboard.json
263
- # and open
264
271
265
272
```
266
273
You can’t perform that action at this time.
0 commit comments