feat: Added labels to scaffolder histogram metrics

Signed-off-by: pmckl <peter.lajos@outlook.com>
This commit is contained in:
pmckl
2025-04-08 15:14:48 +02:00
parent 02981a2377
commit 8685cabe22
2 changed files with 16 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Added `template` and `step` labels for scaffolder historgam metrics: scaffolder_task_duration and scaffolder_step_duration
@@ -634,6 +634,7 @@ function scaffoldingTracker() {
taskCount.add(1, { template, user, result: 'ok' });
taskDuration.record(endTime(), {
template,
result: 'ok',
});
}
@@ -652,6 +653,7 @@ function scaffoldingTracker() {
taskCount.add(1, { template, user, result: 'failed' });
taskDuration.record(endTime(), {
template,
result: 'failed',
});
}
@@ -670,6 +672,7 @@ function scaffoldingTracker() {
taskCount.add(1, { template, user, result: 'cancelled' });
taskDuration.record(endTime(), {
template,
result: 'cancelled',
});
}
@@ -714,6 +717,8 @@ function scaffoldingTracker() {
stepCount.add(1, { template, step: step.name, result: 'ok' });
stepDuration.record(endTime(), {
template,
step: step.name,
result: 'ok',
});
}
@@ -728,6 +733,8 @@ function scaffoldingTracker() {
stepCount.add(1, { template, step: step.name, result: 'cancelled' });
stepDuration.record(endTime(), {
template,
step: step.name,
result: 'cancelled',
});
}
@@ -742,6 +749,8 @@ function scaffoldingTracker() {
stepCount.add(1, { template, step: step.name, result: 'failed' });
stepDuration.record(endTime(), {
template,
step: step.name,
result: 'failed',
});
}
@@ -755,6 +764,8 @@ function scaffoldingTracker() {
stepCount.add(1, { template, step: step.name, result: 'skipped' });
stepDuration.record(endTime(), {
template,
step: step.name,
result: 'skipped',
});
}