-
Notifications
You must be signed in to change notification settings - Fork 147
feat: add actor and kv metrics #3952
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
base: main
Are you sure you want to change the base?
Conversation
|
🚅 Deployed to the rivet-pr-3952 environment in rivet-frontend
|
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. |
67c4a86 to
8b7ad2b
Compare
PR Review: Add Actor and KV MetricsThis PR adds comprehensive metrics tracking for Rivet Actors and KV operations. Overall, the implementation is solid with good patterns, but there are several issues that should be addressed. Critical Issues1. Duplicate Metric Increment in
|
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: |
8b7ad2b to
b47e44c
Compare
b47e44c to
fc05f9d
Compare
| // Update metrics | ||
| keys::ns::metric::inc( | ||
| &tx, | ||
| input.namespace_id, | ||
| keys::ns::metric::Metric::TotalActors(input.name.clone()), | ||
| 1, | ||
| ); | ||
|
|
||
| // Update metrics | ||
| keys::ns::metric::inc( | ||
| &tx, | ||
| input.namespace_id, | ||
| keys::ns::metric::Metric::TotalActors(input.name.clone()), | ||
| 1, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate metric increment will double-count actor creation. The TotalActors metric is incremented twice with identical parameters.
// Remove the duplicate block (lines 121-127)
keys::ns::metric::inc(
&tx,
input.namespace_id,
keys::ns::metric::Metric::TotalActors(input.name.clone()),
1,
);This causes the actor count to be incremented by 2 instead of 1 for each new actor, leading to incorrect metrics reporting.
| // Update metrics | |
| keys::ns::metric::inc( | |
| &tx, | |
| input.namespace_id, | |
| keys::ns::metric::Metric::TotalActors(input.name.clone()), | |
| 1, | |
| ); | |
| // Update metrics | |
| keys::ns::metric::inc( | |
| &tx, | |
| input.namespace_id, | |
| keys::ns::metric::Metric::TotalActors(input.name.clone()), | |
| 1, | |
| ); | |
| // Update metrics | |
| keys::ns::metric::inc( | |
| &tx, | |
| input.namespace_id, | |
| keys::ns::metric::Metric::TotalActors(input.name.clone()), | |
| 1, | |
| ); | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
fc05f9d to
8246e45
Compare

No description provided.