Skip to content

Commit

Permalink
FIX: csm value issue (#2032)
Browse files Browse the repository at this point in the history
* change comments

* add: checking value

* FIX: UI notifications

* FIX: clean extra comments and logs

---------

Co-authored-by: mabasian <[email protected]>
  • Loading branch information
M4r71nW and mabasian authored Sep 4, 2024
1 parent 18d2a35 commit 1b42d99
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
13 changes: 11 additions & 2 deletions launcher/src/backend/Monitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -3459,7 +3459,7 @@ rm -rf diskoutput
/**
* Will gather metrics from Prometheus and evaluate.
* If thresholds are exceeded, an alert will be generated and added to the retuned array.
* @returns {Object[]} Array of alerts e.g. [{name: "Cluster in Unknown Status", level: "warning"}, {name: "Beacon Node Down", level: "critical"}]
* @returns {Object[]} Array of alerts e.g. [{name: "slashing event", level: "critical"},]
*/
async fetchCsmAlerts() {
try {
Expand Down Expand Up @@ -3496,7 +3496,16 @@ rm -rf diskoutput
return [];
}

const value = parseFloat(metric.result.data.result[0].value[1]);
if (!metric.result.data.result || metric.result.data.result.length === 0) {
return [];
}

const metricData = metric.result.data.result[0];
if (!metricData || !metricData.value || metricData.value.length < 2) {
return [];
}

const value = parseFloat(metricData.value[1]);

if (metric.key === "lcoms_current_bond") {
currentBond = value;
Expand Down
12 changes: 11 additions & 1 deletion launcher/src/components/UI/the-control/ControlAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ export default {
async fetchObolCharonAlerts() {
try {
const alerts = await ControlService.fetchObolCharonAlerts();
console.log("Obol Charon alerts:", alerts);
this.processAlerts(alerts);
} catch (error) {
Expand Down Expand Up @@ -846,4 +845,15 @@ export default {
text-transform: uppercase;
margin-bottom: 2%;
}
.val-message span {
display: block;
width: 100%;
height: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
font-size: 42%;
}
</style>

0 comments on commit 1b42d99

Please sign in to comment.