From b77e1730f7925e2b3ebcd2dea23645b8e6fe144b Mon Sep 17 00:00:00 2001 From: Mihir Bhalala <77438541+mihir-4116@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:22:27 +0530 Subject: [PATCH] chore: added statuscode stat for user deletion (#3108) --- src/v0/destinations/af/deleteUsers.js | 1 + src/v0/destinations/am/deleteUsers.js | 1 + src/v0/destinations/braze/deleteUsers.js | 1 + src/v0/destinations/clevertap/deleteUsers.js | 1 + src/v0/destinations/custify/deleteUsers.js | 1 + src/v0/destinations/engage/deleteUsers.js | 1 + src/v0/destinations/intercom/deleteUsers.js | 1 + src/v0/destinations/iterable/deleteUsers.js | 1 + src/v0/destinations/mp/deleteUsers.js | 1 + src/v0/destinations/sendgrid/deleteUsers.js | 1 + src/v0/destinations/sprig/deleteUsers.js | 1 + src/v0/util/tags.js | 3 ++- 12 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/v0/destinations/af/deleteUsers.js b/src/v0/destinations/af/deleteUsers.js index 376fddae97..ab515642aa 100644 --- a/src/v0/destinations/af/deleteUsers.js +++ b/src/v0/destinations/af/deleteUsers.js @@ -50,6 +50,7 @@ const deleteUser = async (config, endpoint, body, identityType, identityValue) = handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/am/deleteUsers.js b/src/v0/destinations/am/deleteUsers.js index 626cf1a769..96c4f7b19c 100644 --- a/src/v0/destinations/am/deleteUsers.js +++ b/src/v0/destinations/am/deleteUsers.js @@ -53,6 +53,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/braze/deleteUsers.js b/src/v0/destinations/braze/deleteUsers.js index b7ed2c4609..33c0f2ef7f 100644 --- a/src/v0/destinations/braze/deleteUsers.js +++ b/src/v0/destinations/braze/deleteUsers.js @@ -56,6 +56,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/clevertap/deleteUsers.js b/src/v0/destinations/clevertap/deleteUsers.js index 342dc4d94f..52119bf0f1 100644 --- a/src/v0/destinations/clevertap/deleteUsers.js +++ b/src/v0/destinations/clevertap/deleteUsers.js @@ -64,6 +64,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/custify/deleteUsers.js b/src/v0/destinations/custify/deleteUsers.js index c335ea0e2d..4a2f87cce9 100644 --- a/src/v0/destinations/custify/deleteUsers.js +++ b/src/v0/destinations/custify/deleteUsers.js @@ -46,6 +46,7 @@ const userDeletionHandler = async (userAttributes, config) => { processedDeletionRequest.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(processedDeletionRequest.status), + [tags.TAG_NAMES.STATUS]: processedDeletionRequest.status, }, deletionResponse, ); diff --git a/src/v0/destinations/engage/deleteUsers.js b/src/v0/destinations/engage/deleteUsers.js index cd95e079e8..3616d2408d 100644 --- a/src/v0/destinations/engage/deleteUsers.js +++ b/src/v0/destinations/engage/deleteUsers.js @@ -54,6 +54,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/intercom/deleteUsers.js b/src/v0/destinations/intercom/deleteUsers.js index 34f193f8a1..2c35f29e53 100644 --- a/src/v0/destinations/intercom/deleteUsers.js +++ b/src/v0/destinations/intercom/deleteUsers.js @@ -49,6 +49,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/iterable/deleteUsers.js b/src/v0/destinations/iterable/deleteUsers.js index fcb72e30b8..015a9de9a0 100644 --- a/src/v0/destinations/iterable/deleteUsers.js +++ b/src/v0/destinations/iterable/deleteUsers.js @@ -49,6 +49,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/mp/deleteUsers.js b/src/v0/destinations/mp/deleteUsers.js index 6c45ac41ad..e1240c609d 100644 --- a/src/v0/destinations/mp/deleteUsers.js +++ b/src/v0/destinations/mp/deleteUsers.js @@ -59,6 +59,7 @@ const deleteProfile = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/sendgrid/deleteUsers.js b/src/v0/destinations/sendgrid/deleteUsers.js index fbd4c80630..ccd277d90d 100644 --- a/src/v0/destinations/sendgrid/deleteUsers.js +++ b/src/v0/destinations/sendgrid/deleteUsers.js @@ -97,6 +97,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/destinations/sprig/deleteUsers.js b/src/v0/destinations/sprig/deleteUsers.js index b2ff18c5a0..01044adcd1 100644 --- a/src/v0/destinations/sprig/deleteUsers.js +++ b/src/v0/destinations/sprig/deleteUsers.js @@ -61,6 +61,7 @@ const userDeletionHandler = async (userAttributes, config) => { handledDelResponse.status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + [tags.TAG_NAMES.STATUS]: handledDelResponse.status, }, handledDelResponse, ); diff --git a/src/v0/util/tags.js b/src/v0/util/tags.js index 18f00f963f..dce8c0a338 100644 --- a/src/v0/util/tags.js +++ b/src/v0/util/tags.js @@ -13,6 +13,7 @@ const TAG_NAMES = { DESTINATION_ID: 'destinationId', WORKSPACE_ID: 'workspaceId', SOURCE_ID: 'sourceId', + STATUS: 'statusCode', }; const MODULES = { @@ -51,7 +52,7 @@ const ERROR_TYPES = { OAUTH_SECRET: 'oAuthSecret', UNSUPPORTED: 'unsupported', REDIS: 'redis', - FILTERED: 'filtered' + FILTERED: 'filtered', }; const METADATA = {