Improve workflow metrics with faillure reason (#18768)

- split workflow errors into system and user errors
- add workspace id to attributes for debugging
This commit is contained in:
Thomas Trompette
2026-03-20 11:04:40 +01:00
committed by GitHub
parent 3cbd9f2b5d
commit ffb02a6878
9 changed files with 68 additions and 16 deletions
@@ -85,11 +85,13 @@ export class MetricsService {
eventId,
attributes,
shouldStoreInCache = true,
debugLog,
}: {
key: MetricsKeys;
eventId?: string;
attributes?: Attributes;
shouldStoreInCache?: boolean;
debugLog?: string;
}) {
const counter = this.getMeter().createCounter(key);
@@ -98,6 +100,10 @@ export class MetricsService {
if (shouldStoreInCache && eventId) {
this.metricsCacheService.updateCounter(key, [eventId]);
}
if (isDefined(debugLog)) {
this.logger.debug(debugLog);
}
}
async batchIncrementCounter({
@@ -22,6 +22,7 @@ export enum MetricsKeys {
WorkflowRunStopped = 'workflow-run/stopped',
WorkflowRunThrottled = 'workflow-run/throttled',
WorkflowRunFailedToEnqueue = 'workflow-run/failed/to-enqueue',
WorkflowRunSystemError = 'workflow-run/system-error',
AIToolExecutionFailed = 'ai-tool-execution/failed',
AIToolExecutionSucceeded = 'ai-tool-execution/succeeded',
SchemaVersionMismatch = 'schema-version/mismatch',