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
1diff --git a/src/reactive/grafana.py b/src/reactive/grafana.py
2index 47d0169..a5cc94b 100644
3--- a/src/reactive/grafana.py
4+++ b/src/reactive/grafana.py
5@@ -886,8 +886,9 @@ def generate_prometheus_dashboards(gf_adminpasswd, ds):
6 "Exception while trying to reach prometheus API: {}".format(e),
7 "ERROR",
8 )
9- hookenv.status_set("blocked", "Exception reaching prometheus API whilst "
10- "updating dashboards")
11+ hookenv.status_set(
12+ "blocked", "Exception reaching prometheus API whilst " "updating dashboards"
13+ )
14 return
15
16 if response.status_code != 200:
17diff --git a/src/templates/dashboards/prometheus/IpmiSensor.json.j2 b/src/templates/dashboards/prometheus/IpmiSensor.json.j2
18index e3acbba..7c7b044 100644
19--- a/src/templates/dashboards/prometheus/IpmiSensor.json.j2
20+++ b/src/templates/dashboards/prometheus/IpmiSensor.json.j2
21@@ -125,7 +125,6 @@
22 "mode": "single"
23 }
24 },
25- "pluginVersion": "7.5.6",
26 "targets": [
27 {
28 "exemplar": true,
29@@ -138,7 +137,7 @@
30 }
31 ],
32 "title": "Temperature",
33- "type": "timeseries"
34+ "type": "graph"
35 },
36 {
37 "datasource": "<< datasource >>",
38@@ -199,7 +198,6 @@
39 "mode": "single"
40 }
41 },
42- "pluginVersion": "7.5.6",
43 "targets": [
44 {
45 "exemplar": true,
46@@ -212,8 +210,82 @@
47 "refId": "PSU1"
48 }
49 ],
50- "title": "PSU",
51- "type": "timeseries"
52+ "title": "Power(watts)",
53+ "type": "graph"
54+ },
55+ {
56+ "datasource": "<< datasource >>",
57+ "fieldConfig": {
58+ "defaults": {
59+ "color": {
60+ "mode": "palette-classic"
61+ },
62+ "custom": {
63+ "axisLabel": "",
64+ "axisPlacement": "auto",
65+ "barAlignment": 0,
66+ "drawStyle": "line",
67+ "fillOpacity": 0,
68+ "gradientMode": "none",
69+ "hideFrom": {
70+ "graph": false,
71+ "legend": false,
72+ "tooltip": false
73+ },
74+ "lineInterpolation": "smooth",
75+ "lineWidth": 1,
76+ "pointSize": 5,
77+ "scaleDistribution": {
78+ "type": "linear"
79+ },
80+ "showPoints": "auto",
81+ "spanNulls": false
82+ },
83+ "mappings": [],
84+ "thresholds": {
85+ "mode": "absolute",
86+ "steps": [
87+ {
88+ "color": "green",
89+ "value": null
90+ }
91+ ]
92+ },
93+ "unit": "volt"
94+ },
95+ "overrides": []
96+ },
97+ "gridPos": {
98+ "h": 8,
99+ "w": 24,
100+ "x": 0,
101+ "y": 8
102+ },
103+ "id": 7,
104+ "options": {
105+ "legend": {
106+ "calcs": [],
107+ "displayMode": "list",
108+ "placement": "bottom"
109+ },
110+ "tooltipOptions": {
111+ "mode": "single"
112+ }
113+ },
114+ "targets": [
115+ {
116+ "exemplar": true,
117+ "expr": "ipmi_sensor{unit=\"volts\", host=~\"$host\"}",
118+ "format": "time_series",
119+ "instant": false,
120+ "interval": "",
121+ "legendFormat": "{{name}}",
122+ "queryType": "randomWalk",
123+ "refId": "PSU2"
124+ }
125+ ],
126+ "title": "Power(volts)",
127+ "type": "graph"
128 },
129 {
130 "datasource": "<< datasource >>",
131@@ -257,7 +329,7 @@
132 }
133 ]
134 },
135- "unit": "percent"
136+ "unit": "rpm"
137 },
138 "overrides": []
139 },
140@@ -278,11 +350,10 @@
141 "mode": "single"
142 }
143 },
144- "pluginVersion": "7.5.6",
145 "targets": [
146 {
147 "exemplar": true,
148- "expr": "ipmi_sensor{unit=\"percent\", host=~\"$host\"}",
149+ "expr": "ipmi_sensor{unit=\"rpm\", host=~\"$host\"}",
150 "format": "time_series",
151 "instant": false,
152 "interval": "",
153@@ -292,7 +363,7 @@
154 }
155 ],
156 "title": "Fan",
157- "type": "timeseries"
158+ "type": "graph"
159 }
160 ],
161 "refresh": false,
162@@ -314,10 +385,7 @@
163 "multi": true,
164 "name": "host",
165 "options": [],
166- "query": {
167- "query": "label_values(ipmi_sensor, host)",
168- "refId": "HostA"
169- },
170+ "query": "label_values(ipmi_sensor, host)",
171 "refresh": 1,
172 "regex": "",
173 "skipUrlSync": false,
174@@ -329,6 +397,11 @@
175 "useTags": false
176 },
177 {
178+ "current": {
179+ "selected": false,
180+ "text": "degrees_c",
181+ "value": "degrees_c"
182+ },
183 "description": null,
184 "error": null,
185 "hide": 2,

Subscribers

People subscribed via source and target branches

to all changes: