-
Notifications
You must be signed in to change notification settings - Fork 147
feat: add metrics to pb, guard #3815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add metrics to pb, guard #3815
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/virtual-websocket
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
649f9ae to
a21ab86
Compare
a21ab86 to
9297e74
Compare
270fad1 to
d77de78
Compare
9297e74 to
442651f
Compare
442651f to
7915d6f
Compare
d77de78 to
4ce772a
Compare
42cfc6d to
506742d
Compare
506742d to
ca4cbfc
Compare
4ce772a to
d7548da
Compare
ca4cbfc to
8102256
Compare
d7548da to
a129485
Compare
a129485 to
45ec780
Compare
4b907cb to
dc985c0
Compare
dc985c0 to
f3f7d72
Compare
45ec780 to
8041bfa
Compare
f3f7d72 to
ae1c40c
Compare
PR Review: Add metrics to pb, guardThis PR adds comprehensive metrics instrumentation to pegboard, guard, and related components. Overall, the implementation is solid and follows good observability practices. Here are my findings: ✅ Strengths
🔍 Issues & Recommendations1. Inconsistent router label casing (engine/packages/guard/src/routing/mod.rs:127-144)Issue: Mixing uppercase and lowercase for the same router labels will create separate time series in Prometheus, making queries confusing. This appears to be a typo. Lines 72 and 82 use lowercase Fix: Use consistent casing (recommend lowercase) throughout. 2. Commented-out aggregate_actor_active function (engine/packages/metrics-aggregator/src/lib.rs:116-189)The Recommendation: Either remove it entirely if not needed, or add a comment explaining why it's disabled and when it will be enabled. 3. Missing integration testsThe new Recommendation: Add integration tests, especially for the pagination logic with the 4. Hard-coded interval (engine/packages/metrics-aggregator/src/lib.rs:23)The 15-second aggregation interval is hard-coded. Recommendation: Make this configurable through 5. Metric reset pattern concern (engine/packages/metrics-aggregator/src/lib.rs:44, 193)Resetting gauges before aggregation can cause brief reporting gaps where metrics show 0 between reset and repopulation. If Prometheus scrapes during this window, it will record incorrect data. Recommendation: Build new values in local state, then update all metrics atomically. 6. Potential memory issue with unbounded label cardinalityMetrics use Monitoring: Ensure you have alerting on metric cardinality growth. 7. Error handling in tick function (engine/packages/metrics-aggregator/src/lib.rs:28)If Recommendation: Log errors and continue rather than crashing the service. 🔒 SecurityNo security concerns identified. The aggregator uses read-only snapshot isolation for database queries. ⚡ Performance
📝 Code StyleMinor style issues:
📊 Test CoverageMissing: No tests for the new metrics-aggregator package SummaryThis is a solid metrics instrumentation PR. The main issues are:
The new metrics will provide valuable observability into pegboard and guard systems. |
PR Review: Add Metrics to Pegboard and GuardOverviewThis PR adds comprehensive metrics instrumentation to the Pegboard runner infrastructure and Guard routing system, along with a new Code Quality & Best PracticesStrengths ✅
Issues to Address
|
8041bfa to
01b117b
Compare
ae1c40c to
3da23f7
Compare
01b117b to
821194e
Compare
3da23f7 to
aea6392
Compare
Merge activity
|

No description provided.