refactor: Telemetry updates (#3529)
* Init unit tests for telemetry * Update telemetry tests * Test Workflow execution errored event * Add new tracking logic in pulse * cleanup * interfaces * Add event_version for Workflow execution count event * add version_cli in all events * add user saved credentials event * update manual wf exec finished, fixes * improve typings, lint * add node_graph_string in User clicked execute workflow button event * add User set node operation or mode event * Add instance started event in FE * Add User clicked retry execution button event * add expression editor event * add input node type to add node event * add User stopped workflow execution wvent * add error message in saved credential event * update stop execution event * add execution preflight event * Remove instance started even tfrom FE, add session started to FE,BE * improve typing * remove node_graph as property from all events * move back from default export * move psl npm package to cli package * cr * update webhook node domain logic * fix is_valid for User saved credentials event * fix Expression Editor variable selector event * add caused_by_credential in preflight event * undo webhook_domain * change node_type to full type * add webhook_domain property in manual execution event (#3680) * add webhook_domain property in manual execution event * lint fix
This commit is contained in:
@@ -112,6 +112,7 @@ import {
|
||||
INodeParameters,
|
||||
INodeProperties,
|
||||
INodeTypeDescription,
|
||||
ITelemetryTrackProperties,
|
||||
NodeHelpers,
|
||||
} from 'n8n-workflow';
|
||||
import CredentialIcon from '../CredentialIcon.vue';
|
||||
@@ -620,7 +621,9 @@ export default mixins(showMessage, nodeHelpers).extend({
|
||||
|
||||
let credential;
|
||||
|
||||
if (this.mode === 'new' && !this.credentialId) {
|
||||
const isNewCredential = this.mode === 'new' && !this.credentialId;
|
||||
|
||||
if (isNewCredential) {
|
||||
credential = await this.createCredential(
|
||||
credentialDetails,
|
||||
);
|
||||
@@ -647,6 +650,30 @@ export default mixins(showMessage, nodeHelpers).extend({
|
||||
this.authError = '';
|
||||
this.testedSuccessfully = false;
|
||||
}
|
||||
|
||||
const trackProperties: ITelemetryTrackProperties = {
|
||||
credential_type: credentialDetails.type,
|
||||
workflow_id: this.$store.getters.workflowId,
|
||||
credential_id: credential.id,
|
||||
is_complete: !!this.requiredPropertiesFilled,
|
||||
is_new: isNewCredential,
|
||||
};
|
||||
|
||||
if (this.isOAuthType) {
|
||||
trackProperties.is_valid = !!this.isOAuthConnected;
|
||||
} else if (this.isCredentialTestable) {
|
||||
trackProperties.is_valid = !!this.testedSuccessfully;
|
||||
}
|
||||
|
||||
if (this.$store.getters.activeNode) {
|
||||
trackProperties.node_type = this.$store.getters.activeNode.type;
|
||||
}
|
||||
|
||||
if (this.authError && this.authError !== '') {
|
||||
trackProperties.authError = this.authError;
|
||||
}
|
||||
|
||||
this.$telemetry.track('User saved credentials', trackProperties);
|
||||
}
|
||||
|
||||
return credential;
|
||||
|
||||
Reference in New Issue
Block a user