Pass task name into item metrics, not task object

This commit is contained in:
Sven Slootweg 2022-11-24 17:19:28 +01:00
parent f7cd69d7d0
commit 31742f8638

View file

@ -80,10 +80,10 @@ module.exports = async function createKernel(_configuration) {
simpleSink(({ status }) => {
if (status === "completed") {
metrics.successfulItems.inc(1);
metrics.successfulItems.labels({ task: task }).inc(1);
metrics.successfulItems.labels({ task: task.name }).inc(1);
} else if (status === "failed") {
metrics.failedItems.inc(1);
metrics.failedItems.labels({ task: task }).inc(1);
metrics.failedItems.labels({ task: task.name }).inc(1);
} else {
unreachable(`Unrecognized status '${status}'`);
}