Merge ~lihuiguo/charm-grafana:bug/1928616-refactor into charm-grafana:master

Proposed by Linda Guo
Status: Merged
Approved by: James Troup
Approved revision: b4c0bf0ab574169f36f51da4e3ee342eabeffba3
Merged at revision: bc68c3faa5ef7fba9eb9ccc68c740881f89d638b
Proposed branch: ~lihuiguo/charm-grafana:bug/1928616-refactor
Merge into: charm-grafana:master
Diff against target: 185 lines (+89/-15)
2 files modified
src/reactive/grafana.py (+3/-2)
src/templates/dashboards/prometheus/IpmiSensor.json.j2 (+86/-13)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-bootstack (community) continuous-integration Approve
BootStack Reviewers Pending
Review via email: mp+405611@code.launchpad.net

Commit message

    changed panel type from timeseries to graph

    timeseries plugin is unavailable on vesion < 7.5.6

To post a comment you must log in.
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision bc68c3faa5ef7fba9eb9ccc68c740881f89d638b

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/reactive/grafana.py b/src/reactive/grafana.py
index 47d0169..a5cc94b 100644
--- a/src/reactive/grafana.py
+++ b/src/reactive/grafana.py
@@ -886,8 +886,9 @@ def generate_prometheus_dashboards(gf_adminpasswd, ds):
886 "Exception while trying to reach prometheus API: {}".format(e),886 "Exception while trying to reach prometheus API: {}".format(e),
887 "ERROR",887 "ERROR",
888 )888 )
889 hookenv.status_set("blocked", "Exception reaching prometheus API whilst "889 hookenv.status_set(
890 "updating dashboards")890 "blocked", "Exception reaching prometheus API whilst " "updating dashboards"
891 )
891 return892 return
892893
893 if response.status_code != 200:894 if response.status_code != 200:
diff --git a/src/templates/dashboards/prometheus/IpmiSensor.json.j2 b/src/templates/dashboards/prometheus/IpmiSensor.json.j2
index e3acbba..7c7b044 100644
--- a/src/templates/dashboards/prometheus/IpmiSensor.json.j2
+++ b/src/templates/dashboards/prometheus/IpmiSensor.json.j2
@@ -125,7 +125,6 @@
125 "mode": "single"125 "mode": "single"
126 }126 }
127 },127 },
128 "pluginVersion": "7.5.6",
129 "targets": [128 "targets": [
130 {129 {
131 "exemplar": true,130 "exemplar": true,
@@ -138,7 +137,7 @@
138 }137 }
139 ],138 ],
140 "title": "Temperature",139 "title": "Temperature",
141 "type": "timeseries"140 "type": "graph"
142 },141 },
143 {142 {
144 "datasource": "<< datasource >>",143 "datasource": "<< datasource >>",
@@ -199,7 +198,6 @@
199 "mode": "single"198 "mode": "single"
200 }199 }
201 },200 },
202 "pluginVersion": "7.5.6",
203 "targets": [201 "targets": [
204 {202 {
205 "exemplar": true,203 "exemplar": true,
@@ -212,8 +210,82 @@
212 "refId": "PSU1"210 "refId": "PSU1"
213 }211 }
214 ],212 ],
215 "title": "PSU",213 "title": "Power(watts)",
216 "type": "timeseries"214 "type": "graph"
215 },
216 {
217 "datasource": "<< datasource >>",
218 "fieldConfig": {
219 "defaults": {
220 "color": {
221 "mode": "palette-classic"
222 },
223 "custom": {
224 "axisLabel": "",
225 "axisPlacement": "auto",
226 "barAlignment": 0,
227 "drawStyle": "line",
228 "fillOpacity": 0,
229 "gradientMode": "none",
230 "hideFrom": {
231 "graph": false,
232 "legend": false,
233 "tooltip": false
234 },
235 "lineInterpolation": "smooth",
236 "lineWidth": 1,
237 "pointSize": 5,
238 "scaleDistribution": {
239 "type": "linear"
240 },
241 "showPoints": "auto",
242 "spanNulls": false
243 },
244 "mappings": [],
245 "thresholds": {
246 "mode": "absolute",
247 "steps": [
248 {
249 "color": "green",
250 "value": null
251 }
252 ]
253 },
254 "unit": "volt"
255 },
256 "overrides": []
257 },
258 "gridPos": {
259 "h": 8,
260 "w": 24,
261 "x": 0,
262 "y": 8
263 },
264 "id": 7,
265 "options": {
266 "legend": {
267 "calcs": [],
268 "displayMode": "list",
269 "placement": "bottom"
270 },
271 "tooltipOptions": {
272 "mode": "single"
273 }
274 },
275 "targets": [
276 {
277 "exemplar": true,
278 "expr": "ipmi_sensor{unit=\"volts\", host=~\"$host\"}",
279 "format": "time_series",
280 "instant": false,
281 "interval": "",
282 "legendFormat": "{{name}}",
283 "queryType": "randomWalk",
284 "refId": "PSU2"
285 }
286 ],
287 "title": "Power(volts)",
288 "type": "graph"
217 },289 },
218 {290 {
219 "datasource": "<< datasource >>",291 "datasource": "<< datasource >>",
@@ -257,7 +329,7 @@
257 }329 }
258 ]330 ]
259 },331 },
260 "unit": "percent"332 "unit": "rpm"
261 },333 },
262 "overrides": []334 "overrides": []
263 },335 },
@@ -278,11 +350,10 @@
278 "mode": "single"350 "mode": "single"
279 }351 }
280 },352 },
281 "pluginVersion": "7.5.6",
282 "targets": [353 "targets": [
283 {354 {
284 "exemplar": true,355 "exemplar": true,
285 "expr": "ipmi_sensor{unit=\"percent\", host=~\"$host\"}",356 "expr": "ipmi_sensor{unit=\"rpm\", host=~\"$host\"}",
286 "format": "time_series",357 "format": "time_series",
287 "instant": false,358 "instant": false,
288 "interval": "",359 "interval": "",
@@ -292,7 +363,7 @@
292 }363 }
293 ],364 ],
294 "title": "Fan",365 "title": "Fan",
295 "type": "timeseries"366 "type": "graph"
296 }367 }
297 ],368 ],
298 "refresh": false,369 "refresh": false,
@@ -314,10 +385,7 @@
314 "multi": true,385 "multi": true,
315 "name": "host",386 "name": "host",
316 "options": [],387 "options": [],
317 "query": {388 "query": "label_values(ipmi_sensor, host)",
318 "query": "label_values(ipmi_sensor, host)",
319 "refId": "HostA"
320 },
321 "refresh": 1,389 "refresh": 1,
322 "regex": "",390 "regex": "",
323 "skipUrlSync": false,391 "skipUrlSync": false,
@@ -329,6 +397,11 @@
329 "useTags": false397 "useTags": false
330 },398 },
331 {399 {
400 "current": {
401 "selected": false,
402 "text": "degrees_c",
403 "value": "degrees_c"
404 },
332 "description": null,405 "description": null,
333 "error": null,406 "error": null,
334 "hide": 2,407 "hide": 2,

Subscribers

People subscribed via source and target branches

to all changes: