Feat/network label consistency - #560
Conversation
|
@GazzyLee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a Prometheus gauge for remaining monthly XLM budget, registers it in a shared observability registry, pins ChangesBudget observability
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
…et headroom - Create src/observability/registry.ts with Prometheus registry - Create src/observability/metrics/budget.ts with sorokeep_budget_remaining_xlm gauge (label: contract_id) - Wire gauge into registry with one import + one registration line - Only emit metric for contracts that have a configured budget - Use existing getMonthlySpendProgress from core/budget.ts + repository functions -- no new SQL - Add TDD tests (both passing): · Contract with limit and spend → remaining = 20 · Contract with no budget → no sample emitted
…signals - Add 'network' to budgetRemainingGauge labelNames - Pass contract.network when setting the gauge value - Update tests to assert network label presence (testnet + mainnet) - Add regression test asserting every metric family includes a network label - Document the labeling convention in the metrics source file Closes #<issue>
…d lockfile update
040aba3 to
827891e
Compare
|
Merged as 2fca7f5 on |
Summary
Adds a
networklabel to thesorokeep_budget_remaining_xlmmetric so testnet and mainnet contracts can be distinguished in dashboards. Without this, a TTL crisis on testnet and one on mainnet produce identical signals on shared Grafana panels.Changes
src/observability/metrics/budget.ts"network"tolabelNamesonbudgetRemainingGaugenetwork: contract.networkin the.set()calltests/observability/metrics/budget.test.tsnetwork: "testnet"on the samplenetwork: "mainnet"register.getMetricsAsArray()and asserts every sample carries anetworklabel — this will catch any future metric that omits the labelTesting
Labeling Convention
Documented in
budget.ts:Closes #346