Skip to content

refactor: remove unused marketo bulk upload metrics - #4537

Merged
koladilip merged 1 commit into
developfrom
feature/cleanup-marketo-bulk-upload-metrics
Jul 28, 2025
Merged

koladilip merged 1 commit into
developfrom
feature/cleanup-marketo-bulk-upload-metrics

Conversation

@koladilip

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Remove 13 unused Marketo bulk upload metrics that were defined but not collected in the transformer service.

What is the related Linear task?

Resolves INT-3978

Please explain the objectives of your changes below

Background

During metrics analysis, it was discovered that several Marketo bulk upload metrics were defined in the Prometheus configuration but never actually collected or used in the codebase. These metrics were likely created for one-time implementation purposes but are no longer needed.

Changes Made

  • Removed 13 unused Marketo bulk upload metrics from :

Any changes to existing capabilities/behaviour, mention the reason & what are the changes?

No breaking changes. These metrics were never collected, so removing their definitions has no impact on functionality. Only the actively used Marketo metrics remain:

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

Performance Improvement: Reduces Prometheus metric cardinality by removing 13 unused metric definitions, which improves Prometheus performance and reduces memory usage.

Developer checklist

  • My code follows the style guidelines of this project
  • No breaking changes are being introduced.
  • All related docs linked with the PR?
  • All changes manually tested?
  • Any documentation changes needed with this change?
  • Is the PR limited to 10 file changes?
  • Is the PR limited to one linear task?
  • Are relevant unit and component test-cases added in new readability format?

@coderabbitai review

- Remove 13 unused marketo_bulk_upload metrics that were defined but not collected
- These metrics were from old implementation and not actively used
- Reduces Prometheus cardinality and improves performance
- Keeps only actively used marketo metrics: fetch_token, lead_lookup, activity

Fixes INT-3978
@koladilip
koladilip requested review from a team as code owners July 28, 2025 11:26
@coderabbitai

coderabbitai Bot commented Jul 28, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Removed several internal metrics related to the Marketo bulk upload process. No changes to visible features or user-facing functionality.

Walkthrough

The changes remove multiple Prometheus metric definitions related to "marketo_bulk_upload" from the createMetrics method within the Prometheus class in src/util/prometheus.js. No other logic or control flow is altered, and there are no modifications to exported or public entity declarations.

Changes

Cohort / File(s) Change Summary
Marketo Bulk Upload Metrics Removal
src/util/prometheus.js
Deleted several Prometheus counter and histogram metric definitions associated with "marketo_bulk_upload" processes from the createMetrics method. No other logic or exports affected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested reviewers

  • sivashanmukh
  • vinayteki95
  • manish339k

Suggestion:
Consider documenting the rationale for removing these metrics, especially if downstream consumers or monitoring dashboards depend on them. This will aid future maintainers in understanding the context behind the change.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66686b0 and 12ab0e1.

📒 Files selected for processing (1)
  • src/util/prometheus.js (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit Configuration File

Focus on ESLint errors (max 3) and warnings (max 5).

Files:

  • src/util/prometheus.js
🧠 Learnings (2)
📓 Common learnings
Learnt from: maheshkutty
PR: rudderlabs/rudder-transformer#4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The `combineBatchRequestsWithSameJobIds` function in `src/v0/util/index.js` is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.
src/util/prometheus.js (1)

Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
src/util/prometheus.js (5)

299-299: LGTM: Clean removal of unused metrics.

The removal of marketo bulk upload metrics at this location maintains proper array syntax and structure. The cleanup aligns with the PR objective to reduce Prometheus metric cardinality.


342-342: Clean metric removal with proper array structure.

The removal maintains correct array syntax and the flow between remaining metrics is logical.


632-632: Histogram metrics cleanly removed.

The removal of marketo bulk upload histogram metrics maintains proper array structure and the transition between metric types is seamless.


663-663: Final metric removal point executed cleanly.

The last removal point maintains proper syntax and the overall refactoring successfully removes unused marketo bulk upload metrics without impacting the core Prometheus functionality.


220-1034: Excellent cleanup: unused metrics removed without functional impact.

This refactoring successfully removes 13 unused marketo bulk upload metrics while maintaining:

  • Proper array syntax throughout the metrics configuration
  • Clean code structure in the createMetrics method
  • No breaking changes since the metrics were never actively collected
  • Performance improvement through reduced Prometheus metric cardinality

The implementation demonstrates good technical debt management and aligns perfectly with the stated PR objectives.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/cleanup-marketo-bulk-upload-metrics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Jul 28, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.57%. Comparing base (5d4372a) to head (12ab0e1).
⚠️ Report is 6 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4537      +/-   ##
===========================================
+ Coverage    91.44%   91.57%   +0.12%     
===========================================
  Files          639      639              
  Lines        33774    33774              
  Branches      7978     7985       +7     
===========================================
+ Hits         30885    30928      +43     
+ Misses        2655     2616      -39     
+ Partials       234      230       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@koladilip
koladilip merged commit 8ebd24b into develop Jul 28, 2025
@koladilip
koladilip deleted the feature/cleanup-marketo-bulk-upload-metrics branch July 28, 2025 13:51
koladilip added a commit that referenced this pull request Jul 31, 2025
* chore: ai generated docs for airship

* chore: migrate some streaming destination to new test format (#4435)

* chore: migrate some streaming destination to new test format

* chore: rebase to develop

* fix: type

* chore: review comments

* chore: ing-svc workflow takes latest go tests

* chore: restart deployment after creating a develop image (#4528)

* chore: restart deployment after creating a develop image

* fix: review comments

* fix: add dependencies for kubectl

* chore: review comments

* chore: review comments

* chore: add another job for dedicated deployment

* chore: update sku mappings for product viewed event (#4467)

* chore: update sku mappings for product viewed event, fix skipped tests

* chore: remove skip false

---------

Co-authored-by: Mahesh Kutty <[email protected]>

* chore: add checkout step for deployment restart action (#4532)

* chore: auto create ing-svc pr for go-tests

* chore: restructure workflows

* chore: workflow add permissions

* chore: address security and compatibility issues

* refactor: remove unused marketo bulk upload metrics (#4537)

- Remove 13 unused marketo_bulk_upload metrics that were defined but not collected
- These metrics were from old implementation and not actively used
- Reduces Prometheus cardinality and improves performance
- Keeps only actively used marketo metrics: fetch_token, lead_lookup, activity

Fixes INT-3978

* chore: use latest vars for pod restart (#4538)

* chore: gitworkflow version upgrades

* chore: scan push revert to old version

* chore: add lint rules to catch invalid or unresolved imports (#4531)

* feat: onboard postscript destination (#4438)

* feat: onboard postscript destination

* chore: add nwhandler tests

* chore: add comments, update tests, fix properties inconsistencies

* chore: address comments

* chore: add util tests

* feat: onboard postscript destination

* chore: add nwhandler tests

* chore: add comments, update tests, fix properties inconsistencies

* chore: address comments

* chore: add util tests

* chore: address comments

* fix: subscriber updation logic

* chore: add tests for code coverage

* chore: address comments

* chore: address comments, add docs

* chore: remove catch

---------

Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>

* chore(release): 1.106.0

---------

Co-authored-by: Vinay Teki <[email protected]>
Co-authored-by: Dilip Kola <[email protected]>
Co-authored-by: Manish Kumar <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Yashasvi Bajpai <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
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.

4 participants