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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user