feat: add network label to prometheus metrics#569
Open
silent-cipher wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Dealbot’s Prometheus metrics to include a network label, aligning metrics emission with the multi-network schema work introduced in #463 and preventing cross-network metric collisions.
Changes:
- Adds
networkto Prometheus label sets for check metrics, job/queue metrics, wallet balance, and storage provider gauges. - Updates metric label builders and call sites to consistently include
network. - Adjusts unit tests to assert the new label behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/backend/src/retrieval/retrieval.service.ts | Adds network to retrieval check metric labels. |
| apps/backend/src/pull-check/pull-check.service.ts | Adds network to pull-check metric labels. |
| apps/backend/src/metrics-prometheus/wallet-balance.collector.ts | Emits wallet balance metrics labeled by network. |
| apps/backend/src/metrics-prometheus/metrics-prometheus.module.ts | Updates Prometheus metric definitions to include network in labelNames. |
| apps/backend/src/metrics-prometheus/check-metrics.service.ts | Ensures deal-derived labels include network. |
| apps/backend/src/metrics-prometheus/check-metric-labels.ts | Extends label types/builder to require and return network. |
| apps/backend/src/jobs/jobs.service.ts | Adds network to storage provider gauges and pg-boss/job metrics emissions. |
| apps/backend/src/jobs/jobs.service.spec.ts | Updates job metric expectations to include network. |
| apps/backend/src/deal/deal.service.ts | Adds network to data storage + dataset creation metric labels. |
| apps/backend/src/deal/deal.service.spec.ts | Updates deal metric label expectations to include network. |
| apps/backend/src/deal-addons/strategies/ipni.strategy.spec.ts | Updates IPNI strategy tests to include network in metric labels. |
| apps/backend/src/data-retention/data-retention.service.ts | Adds network to data-retention metric labels and standardizes config access. |
| apps/backend/src/data-retention/data-retention.service.spec.ts | Updates data-retention metric assertions to include network. |
SgtPooki
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Built on top of #463