PyObservability 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyobservability/monitor.py +4 -4
- pyobservability/static/app.js +28 -20
- pyobservability/version.py +1 -1
- {pyobservability-0.0.2.dist-info → pyobservability-0.0.3.dist-info}/METADATA +1 -1
- {pyobservability-0.0.2.dist-info → pyobservability-0.0.3.dist-info}/RECORD +9 -9
- {pyobservability-0.0.2.dist-info → pyobservability-0.0.3.dist-info}/WHEEL +0 -0
- {pyobservability-0.0.2.dist-info → pyobservability-0.0.3.dist-info}/entry_points.txt +0 -0
- {pyobservability-0.0.2.dist-info → pyobservability-0.0.3.dist-info}/licenses/LICENSE +0 -0
- {pyobservability-0.0.2.dist-info → pyobservability-0.0.3.dist-info}/top_level.txt +0 -0
pyobservability/monitor.py
CHANGED
|
@@ -119,13 +119,13 @@ class Monitor:
|
|
|
119
119
|
return await resp.json()
|
|
120
120
|
except Exception as err:
|
|
121
121
|
LOGGER.debug(err)
|
|
122
|
-
return
|
|
122
|
+
return
|
|
123
123
|
parsed = urlparse(url)
|
|
124
124
|
LOGGER.debug("Exception on '%s' - [%d]: %s", parsed.path, resp.status, await resp.text())
|
|
125
|
-
return
|
|
125
|
+
return
|
|
126
126
|
except Exception as err:
|
|
127
127
|
LOGGER.debug(err)
|
|
128
|
-
return
|
|
128
|
+
return
|
|
129
129
|
|
|
130
130
|
############################################################################
|
|
131
131
|
# PER-TARGET POLLING
|
|
@@ -151,7 +151,7 @@ class Monitor:
|
|
|
151
151
|
|
|
152
152
|
for (key, _), resp in zip(tasks.items(), raw_results):
|
|
153
153
|
if isinstance(resp, Exception):
|
|
154
|
-
result["metrics"][key] =
|
|
154
|
+
result["metrics"][key] = None
|
|
155
155
|
continue
|
|
156
156
|
if isinstance(resp, dict):
|
|
157
157
|
result["metrics"][key] = resp.get("detail", resp)
|
pyobservability/static/app.js
CHANGED
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
const free = m.disk.free ?? "—";
|
|
243
243
|
diskEl.textContent = `Total: ${total}\nUsed: ${used}\nFree: ${free}`;
|
|
244
244
|
} else {
|
|
245
|
-
diskEl.textContent = "
|
|
245
|
+
diskEl.textContent = "NO DATA";
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
// ------------------- MEMORY -------------------
|
|
@@ -252,6 +252,8 @@
|
|
|
252
252
|
const totalMem = m.memory.ram_total ?? m.memory.total ?? "—";
|
|
253
253
|
memEl.textContent = `Total: ${totalMem}\nUsed: ${used}\nPercent: ${percent}%`;
|
|
254
254
|
pushPoint(memChart, num(percent));
|
|
255
|
+
} else {
|
|
256
|
+
memEl.textContent = "NO DATA"
|
|
255
257
|
}
|
|
256
258
|
|
|
257
259
|
// ------------------- CPU -------------------
|
|
@@ -306,6 +308,8 @@
|
|
|
306
308
|
loadEl.textContent = load;
|
|
307
309
|
pushPoint(loadChart, num(load));
|
|
308
310
|
}
|
|
311
|
+
} else {
|
|
312
|
+
loadEl.textContent = "NO DATA"
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
// ------------------- SERVICES -------------------
|
|
@@ -328,31 +332,31 @@
|
|
|
328
332
|
`;
|
|
329
333
|
servicesTableBody.appendChild(tr);
|
|
330
334
|
}
|
|
335
|
+
} else {
|
|
336
|
+
servicesTableBody.innerHTML = `<tr><td colspan="5">NO DATA</td></tr>`;
|
|
331
337
|
}
|
|
332
338
|
|
|
333
339
|
// ------------------- DOCKER -------------------
|
|
334
340
|
const dockerList = m.docker_stats;
|
|
335
341
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
// Table header
|
|
342
|
-
const columns = Object.keys(dockerList[0]);
|
|
343
|
-
dockerTableHead.innerHTML =
|
|
344
|
-
"<tr>" + columns.map(c => `<th>${c}</th>`).join("") + "</tr>";
|
|
345
|
-
|
|
346
|
-
// Table rows
|
|
347
|
-
dockerList.forEach(c => {
|
|
348
|
-
const row = "<tr>" +
|
|
349
|
-
columns.map(col => `<td>${c[col] ?? ""}</td>`).join("") +
|
|
350
|
-
"</tr>";
|
|
351
|
-
dockerTableBody.insertAdjacentHTML("beforeend", row);
|
|
352
|
-
});
|
|
353
|
-
}
|
|
342
|
+
dockerTableHead.innerHTML = "";
|
|
343
|
+
dockerTableBody.innerHTML = "";
|
|
344
|
+
|
|
345
|
+
if (!Array.isArray(dockerList) || dockerList.length === 0) {
|
|
346
|
+
dockerTableBody.innerHTML = `<tr><td colspan="10">NO DATA</td></tr>`;
|
|
354
347
|
} else {
|
|
355
|
-
|
|
348
|
+
// Create header
|
|
349
|
+
const columns = Object.keys(dockerList[0]);
|
|
350
|
+
dockerTableHead.innerHTML =
|
|
351
|
+
"<tr>" + columns.map(c => `<th>${c}</th>`).join("") + "</tr>";
|
|
352
|
+
|
|
353
|
+
// Create rows
|
|
354
|
+
dockerList.forEach(c => {
|
|
355
|
+
const row = "<tr>" +
|
|
356
|
+
columns.map(col => `<td>${c[col] ?? ""}</td>`).join("") +
|
|
357
|
+
"</tr>";
|
|
358
|
+
dockerTableBody.insertAdjacentHTML("beforeend", row);
|
|
359
|
+
});
|
|
356
360
|
}
|
|
357
361
|
|
|
358
362
|
// ------------------- DISKS -------------------
|
|
@@ -367,11 +371,15 @@
|
|
|
367
371
|
`;
|
|
368
372
|
disksTableBody.appendChild(tr);
|
|
369
373
|
}
|
|
374
|
+
} else {
|
|
375
|
+
disksTableBody.innerHTML = `<tr><td colspan="3">NO DATA</td></tr>`;
|
|
370
376
|
}
|
|
371
377
|
|
|
372
378
|
// ------------------- CERTIFICATES -------------------
|
|
373
379
|
if (m.certificates) {
|
|
374
380
|
certsEl.textContent = JSON.stringify(m.certificates, null, 2);
|
|
381
|
+
} else {
|
|
382
|
+
certsEl.textContent = "NO DATA"
|
|
375
383
|
}
|
|
376
384
|
}
|
|
377
385
|
}
|
pyobservability/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.3"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
pyobservability/__init__.py,sha256=rr4udGMbbNPl3yo7l8R3FUUVVahBtYVaW6vSWWgXlv0,2617
|
|
2
2
|
pyobservability/main.py,sha256=QCoALD_vk3S5XKEIwMI_LzfNixzq7xpIS0uA21uMqs0,3414
|
|
3
|
-
pyobservability/monitor.py,sha256=
|
|
4
|
-
pyobservability/version.py,sha256=
|
|
3
|
+
pyobservability/monitor.py,sha256=bDbkSOHgtS_9Jv7IqZ9eN1P_-cFeZFlnozRo2N6hh_s,6578
|
|
4
|
+
pyobservability/version.py,sha256=4GZKi13lDTD25YBkGakhZyEQZWTER_OWQMNPoH_UM2c,22
|
|
5
5
|
pyobservability/config/enums.py,sha256=iMIOpa8LYSszkPIYBhupX--KrEXVTTsBurinpAxLvMA,86
|
|
6
6
|
pyobservability/config/settings.py,sha256=HoDRuzwCCbCdNQLdOiy9JUoiM2BqUsRkX6zUyDLordY,3811
|
|
7
|
-
pyobservability/static/app.js,sha256=
|
|
7
|
+
pyobservability/static/app.js,sha256=nXUWAoRDUTKAtRfLmg6GveBQlRtNk-UoVp09AXvSlrA,13743
|
|
8
8
|
pyobservability/static/styles.css,sha256=t6r1C0ueBanipgRRjdu18nmq6RbSGLK5bhpf0BdMOpQ,3245
|
|
9
9
|
pyobservability/templates/index.html,sha256=PsN3aq-7Q6RzGeshoNH5v37G3sHoI2saJq6mfuA6JYs,3977
|
|
10
|
-
pyobservability-0.0.
|
|
11
|
-
pyobservability-0.0.
|
|
12
|
-
pyobservability-0.0.
|
|
13
|
-
pyobservability-0.0.
|
|
14
|
-
pyobservability-0.0.
|
|
15
|
-
pyobservability-0.0.
|
|
10
|
+
pyobservability-0.0.3.dist-info/licenses/LICENSE,sha256=_sOIKJWdD2o1WwwDIwYB2qTP2nlSWqT5Tyg9jr1Xa4w,1070
|
|
11
|
+
pyobservability-0.0.3.dist-info/METADATA,sha256=mdFfoTsAoeh2HlXq6ndwjzwVVM17xT8IwQh1NQEr1QQ,6822
|
|
12
|
+
pyobservability-0.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
pyobservability-0.0.3.dist-info/entry_points.txt,sha256=DSGIr_VA8Tb3FYa2iNUYpf55eAvuFCAoInNS4ngXaME,57
|
|
14
|
+
pyobservability-0.0.3.dist-info/top_level.txt,sha256=p20T0EmihDYW1uMintRXr7X9bg3XWYKyoSbBHOVC1xI,16
|
|
15
|
+
pyobservability-0.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|