Skip to content

chore: add user deletion stats for regulation worker at destType level - #2884

Merged
anantjain45823 merged 2 commits into
developfrom
chore.adduserDeleteStats
Dec 8, 2023
Merged

anantjain45823 merged 2 commits into
developfrom
chore.adduserDeleteStats

Conversation

@anantjain45823

@anantjain45823 anantjain45823 commented Dec 7, 2023 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Linear: Resolves INT-1149
Adding metrics for regulation worker user deletion requests on destType level

Please 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_latency

Labels: destType, feature, implementation

Metric name: regulation_worker_user_deletion_failure

Labels: 'destType', 'module', 'implementation', 'feature'

Type of change

chore

  • Existing capabilities/behavior -> Had metrics on latency in total for user deletion requests independent of destType

  • New capabilities/behavior-> New metric for count, latency and failure count is added on destType tag


Developer 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

    • Introduced new metrics to monitor user deletion failures and request latencies.
  • Improvements

    • Enhanced tracking capabilities with additional labels for detailed metric information.
  • Bug Fixes

    • Implemented tracking for user deletion failures due to regulation worker errors.

@anantjain45823 anantjain45823 self-assigned this Dec 7, 2023
@anantjain45823
anantjain45823 requested review from a team and sivashanmukh as code owners December 7, 2023 04:35
@coderabbitai

coderabbitai Bot commented Dec 7, 2023 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes across the codebase involve the introduction of new metrics and monitoring capabilities. A stats module is imported to track request latency and increment counters for specific events, such as user deletion failures. The Prometheus class is updated with new metrics to monitor these events, and existing metrics are adjusted to refine the granularity of the data collected.

Changes

File Path Change Summary
.../destination/nativeIntegration.ts Added stats module import; introduced startTime variable and stats.timing method call for latency tracking.
.../destination/postTransformation.ts Added stats.increment call to track user deletion failures.
src/util/prometheus.js Added new metrics for user deletion failures and request latency; modified label names and metric configurations.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@codecov

codecov Bot commented Dec 7, 2023 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e1714bd) 87.19% compared to head (1abfec7) 87.19%.

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.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

sonarqubecloud Bot commented Dec 7, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
40.0% 40.0% Duplication

@anantjain45823

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e1714bd and 1abfec7.
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 processUserDeletion is 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 that metaTo.errorDetails contains 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_failure metric with labels for destType, module, implementation, and feature aligns 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_event metric 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_latency metric'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_latency metric with labels for feature, implementation, and destType aligns 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_events metric with labels for errored, statusCode, transformationId, and workspaceId is not mentioned in the summary. Please confirm if this addition aligns with the PR objectives.

  • 946-950: The addition of the user_transform_function_latency metric with labels for errored, statusCode, transformationId, and workspaceId is not mentioned in the summary. Please confirm if this addition aligns with the PR objectives.

@anantjain45823
anantjain45823 merged commit c8e5bfb into develop Dec 8, 2023
@devops-github-rudderstack
devops-github-rudderstack deleted the chore.adduserDeleteStats branch March 8, 2024 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants