fix(core): Fix telemetry execution status for manual workflows executions (#5712)

fix telemetry execution status
This commit is contained in:
Michael Auerswald 2023-03-17 11:02:48 +01:00 committed by GitHub
parent f59b591c93
commit a28396ee91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -284,6 +284,15 @@ export class InternalHooks implements IInternalHooksClass {
properties.user_id = userId;
}
let executionStatus: ExecutionStatus;
if (runData?.status === 'crashed') {
executionStatus = 'crashed';
} else if (runData?.status === 'waiting' || runData?.data?.waitTill) {
executionStatus = 'waiting';
} else {
executionStatus = properties.success ? 'success' : 'failed';
}
if (runData !== undefined) {
properties.execution_mode = runData.mode;
properties.success = !!runData.finished;
@ -342,7 +351,7 @@ export class InternalHooks implements IInternalHooksClass {
const manualExecEventProperties: ITelemetryTrackProperties = {
user_id: userId,
workflow_id: workflow.id,
status: properties.success ? 'success' : 'failed',
status: executionStatus,
executionStatus: runData?.status ?? 'unknown',
error_message: properties.error_message as string,
error_node_type: properties.error_node_type,
@ -392,15 +401,6 @@ export class InternalHooks implements IInternalHooksClass {
}
}
let executionStatus: ExecutionStatus;
if (runData?.status === 'crashed') {
executionStatus = 'crashed';
} else if (runData?.status === 'waiting' || runData?.data?.waitTill) {
executionStatus = 'waiting';
} else {
executionStatus = properties.success ? 'success' : 'failed';
}
promises.push(
Db.collections.Execution.update(executionId, {
status: executionStatus,