Repository navigation
chore: add user deletion stats for regulation worker at destType level - #2884
Conversation
WalkthroughThe changes across the codebase involve the introduction of new metrics and monitoring capabilities. A Changes
TipsChat with CodeRabbit Bot (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2884 +/- ##
========================================
Coverage 87.19% 87.19%
========================================
Files 776 776
Lines 28943 28947 +4
Branches 6791 6791
========================================
+ Hits 25237 25241 +4
Misses 3364 3364
Partials 342 342 ☔ View full report in Codecov by Sentry. |
|
Kudos, SonarCloud Quality Gate passed!
|
|
@coderabbitai review |
There was a problem hiding this comment.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (3)
- src/services/destination/nativeIntegration.ts (3 hunks)
- src/services/destination/postTransformation.ts (1 hunks)
- src/util/prometheus.js (4 hunks)
Additional comments: 8
src/services/destination/nativeIntegration.ts (1)
- 231-231: Verify if hardcoding the destination ID and workspace ID as 'unknown' in the metadata within the catch block of
processUserDeletionis the desired behavior, or if these values should be retrieved from the request object when available.src/services/destination/postTransformation.ts (1)
- 161-167: The addition of
stats.increment('regulation_worker_user_deletion_failure', metaTo.errorDetails);correctly implements the tracking of user deletion request failures as per the PR objectives. Ensure thatmetaTo.errorDetailscontains the necessary labels (destType,feature,implementation,module) as expected by the metric.src/util/prometheus.js (6)
451-458: The addition of the
regulation_worker_user_deletion_failuremetric with labels fordestType,module,implementation, andfeaturealigns with the PR objectives to track user deletion request failures at a granular level.461-462: The summary mentions a modification to the
shopify_server_side_identifier_eventmetric configuration, but the hunk does not show any changes to this metric. Please verify if the changes were made in another part of the file or if the summary is incorrect.615-616: The summary mentions an update to the
dest_transform_request_latencymetric's data structure, but the hunk does not show any changes to this metric. Please verify if the changes were made in another part of the file or if the summary is incorrect.609-612: The addition of the
regulation_worker_requests_dest_latencymetric with labels forfeature,implementation, anddestTypealigns with the PR objectives to track the latency of user deletion requests by destination type.930-934: The addition of the
user_transform_function_input_eventsmetric with labels forerrored,statusCode,transformationId, andworkspaceIdis not mentioned in the summary. Please confirm if this addition aligns with the PR objectives.946-950: The addition of the
user_transform_function_latencymetric with labels forerrored,statusCode,transformationId, andworkspaceIdis not mentioned in the summary. Please confirm if this addition aligns with the PR objectives.








What are the changes introduced in this PR?
Linear: Resolves INT-1149
Adding metrics for regulation worker user deletion requests on
destTypelevelPlease explain the objectives of your changes below
Currently we do not have any metrics for user deletion / regulation worker requests to find count of requests destination wise.
So we need to add metric for the same in nativeIntegration.ts
(P.S. We are not adding it in regulation.ts as it contains array of all these requests which can contain requests of different destType)
Also for failure count for userDeletion module there is TODO item as well. So picking it up in the same
Metric name:
regulation_worker_requests_dest_latencyLabels:
destType, feature, implementationMetric name:
regulation_worker_user_deletion_failureLabels:
'destType', 'module', 'implementation', 'feature'Type of change
chore
Existing capabilities/behavior -> Had metrics on latency in total for user deletion requests independent of
destTypeNew capabilities/behavior-> New metric for count, latency and failure count is added on
destTypetagDeveloper checklist
No breaking changes are being introduced.
Are all related docs linked with the PR?
Are all changes manually tested?
Does this change require any documentation changes?
Are relevant unit and component test-cases added?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes