Skip to content

refactor: move check-metric helpers from metrics/ to metrics-prometheus/#398

Merged
silent-cipher merged 1 commit intoFilOzone:mainfrom
Chaitu-Tatipamula:move-check-metric-helpers
Apr 2, 2026
Merged

refactor: move check-metric helpers from metrics/ to metrics-prometheus/#398
silent-cipher merged 1 commit intoFilOzone:mainfrom
Chaitu-Tatipamula:move-check-metric-helpers

Conversation

@Chaitu-Tatipamula
Copy link
Copy Markdown
Collaborator

@Chaitu-Tatipamula Chaitu-Tatipamula commented Mar 25, 2026

Summary

Moves check-metrics.service.ts and check-metric-labels.ts out of metrics/utils/ into metrics-prometheus/, creating a neutral home for these shared helpers so they survive the upcoming metrics module removal.

No behavior change — this is a pure import path update.

What changed

  • Moved check-metrics.service.ts and check-metric-labels.tssrc/metrics-prometheus/
  • Updated imports across all consumers:
    • deal/deal.service.ts + spec
    • retrieval/retrieval.service.ts + spec
    • data-retention/data-retention.service.ts + spec
    • deal-addons/strategies/ipni.strategy.ts + spec
    • metrics-prometheus/metrics-prometheus.module.ts
  • Deleted the old copies from metrics/utils/

Why

These helpers (buildCheckMetricLabels, DataStorageCheckMetrics, RetrievalCheckMetrics, etc.) are used by deal/, retrieval/, and deal-addons/ — none of which depend on the legacy metrics module. Moving them now means we can safely delete metrics/ in later PRs without breaking these consumers.

Testing

  • pnpm typecheck
  • pnpm test — 21 test files, 271 tests passed ✅

Part of #275

This is step 1 of the metrics cleanup plan.

…metheus

move check-metrics.service.ts and check-metric-labels.ts to
metrics-prometheus/ and update all imports across deal/, retrieval/,
data-retention/, deal-addons/, and metrics-prometheus.module.ts.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the backend metrics code by relocating shared “check-metric” helpers into metrics-prometheus/ so non-legacy consumers (deal/retrieval/addons/data-retention) can keep using them as the legacy metrics/ module is phased out.

Changes:

  • Moved check-metrics.service.ts and check-metric-labels.ts into src/metrics-prometheus/.
  • Updated all import paths in runtime code and tests to reference the new locations.
  • Removed the old helper copies from metrics/utils/.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/backend/src/retrieval/retrieval.service.ts Updates check-metric helper imports to the new metrics-prometheus/ location.
apps/backend/src/retrieval/retrieval.service.spec.ts Updates test imports for moved check-metric helpers.
apps/backend/src/metrics-prometheus/metrics-prometheus.module.ts Switches module import to the colocated check-metrics.service.
apps/backend/src/metrics-prometheus/check-metrics.service.ts Adjusts internal relative imports after the file move.
apps/backend/src/metrics-prometheus/check-metric-labels.ts Adds the relocated check-metric label helpers in the new directory.
apps/backend/src/deal/deal.service.ts Updates check-metric helper imports to metrics-prometheus/.
apps/backend/src/deal/deal.service.spec.ts Updates test imports for moved check-metric helpers.
apps/backend/src/deal-addons/strategies/ipni.strategy.ts Updates check-metric helper imports to metrics-prometheus/.
apps/backend/src/deal-addons/strategies/ipni.strategy.spec.ts Updates test imports for moved check-metric helpers.
apps/backend/src/data-retention/data-retention.service.ts Updates check-metric label helper imports to metrics-prometheus/.
apps/backend/src/data-retention/data-retention.service.spec.ts Updates test imports for moved check-metric label helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@silent-cipher silent-cipher left a comment

Choose a reason for hiding this comment

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

LGTM! Migration looks complete.

@github-project-automation github-project-automation bot moved this from 📌 Triage to ✔️ Approved by reviewer in FOC Mar 27, 2026
@BigLep
Copy link
Copy Markdown
Contributor

BigLep commented Mar 27, 2026

@silent-cipher : will you handle merging?

@silent-cipher
Copy link
Copy Markdown
Collaborator

Yes, I'll handle the merging

@silent-cipher silent-cipher merged commit 544de7c into FilOzone:main Apr 2, 2026
11 checks passed
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

5 participants