-
Notifications
You must be signed in to change notification settings - Fork 146
feat: add actor and kv metrics #3928
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 actor and kv metrics #3928
Conversation
|
🚅 Deployed to the rivet-pr-3928 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
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: |
PR Review: Add Actor and KV MetricsThis PR adds comprehensive metrics tracking for Rivet Actors and KV operations. The changes consolidate KV key management, add namespace-scoped metrics, and update Grafana dashboards. 🎯 SummaryScope: Adding metrics infrastructure for actor lifecycle and KV operations
✅ Strengths
🐛 Critical Issues1. Compilation Error in
|
| Category | Rating | Notes |
|---|---|---|
| Functionality | 🔴 Critical | Multiple compilation errors prevent merge |
| Code Quality | 🟡 Moderate | Some type inconsistencies and duplicates |
| Security | 🟢 Good | No issues identified |
| Performance | 🟢 Good | Appropriate use of chunking and transactions |
| Testing | 🔴 Critical | Test files appear empty |
| Documentation | 🟡 Moderate | Some inconsistent comments |
🚀 Required Actions Before Merge
-
Fix compilation errors in
setup.rs:- Replace
name.clone()withinput.name.clone()(3 occurrences) - Remove duplicate metric increment (lines 123-129)
- Replace
-
Fix
get_for_runner.rs:- Use
input.actor_idinstead ofactor_id - Fix return type inconsistency
- Replace
ActorwithOutput - Remove or fix undefined variable references
- OR: Consider if this file should be reverted/rewritten
- Use
-
Fix type inconsistency in
metric.rs:85:- Use
i64::from_le_bytesinstead ofusize::from_le_bytes
- Use
-
Fix
backfill_udb_keys_and_metrics:- Use
state.namespace_idandstate.name.clone()
- Use
-
Add test coverage:
- Implement tests in the empty test files
- Cover KV operations and metric tracking
-
Consider improving overflow handling:
- Replace
.unwrap_or_default()with proper error handling or saturating cast
- Replace
💡 Suggestions for Follow-up
- Metric aggregation: Consider adding a background job to aggregate metrics periodically
- Storage metrics: The
KvStorageUsedmetric is defined but may need periodic recalculation - Actor awake time tracking: Ensure there's a mechanism to track and update
ActorAwakehours - Documentation: Add examples of how to query these metrics from Grafana
Conclusion: This PR cannot be merged in its current state due to compilation errors. The core concept and architecture are solid, but implementation issues need to be resolved first.
ee27a16 to
192c800
Compare
88935a1 to
cbdc9b0
Compare
cbdc9b0 to
67c4a86
Compare
Merge activity
|
This reverts commit 93d5dd9.

No description provided.