tracking UnhandledPromiseRejection(s) (#3386)

This commit is contained in:
g11tech
2021-10-26 02:58:42 +05:30
committed by GitHub
parent 7bd7467b34
commit 694a6562a6
3 changed files with 88 additions and 0 deletions

View File

@@ -2236,6 +2236,87 @@
"align": false,
"alignLevel": null
}
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 51
},
"id": 268,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"exemplar": false,
"expr": "rate(unhandeled_promise_rejections[$__rate_interval])",
"interval": "",
"legendFormat": "Errors",
"refId": "A"
}
],
"title": "UnhandledPromiseRejection rate",
"type": "timeseries"
}
],
"title": "VM Stats",

View File

@@ -33,6 +33,9 @@ export function createMetrics(
const clockSlot = getCurrentSlot(config, genesisTime);
validatorMonitor.scrapeMetrics(clockSlot);
});
process.on("unhandledRejection", (_error) => {
lodestar.unhandeledPromiseRejections.inc();
});
collectDefaultMetrics({
register,

View File

@@ -529,5 +529,9 @@ export function createLodestarMetrics(
help: "regen function total errors",
labelNames: ["entrypoint", "caller"],
}),
unhandeledPromiseRejections: register.gauge({
name: "unhandeled_promise_rejections",
help: "UnhandeledPromiseRejection count",
}),
};
}