You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds duration/size Prometheus histograms for serde hot paths in rivetkit-core, following the same LazyLock collector + register_metric-with-warn-on-duplicate pattern already used by rivet-envoy-client (engine/sdks/rust/envoy-client/src/metrics.rs), and reuses the exact byte-size buckets from the engine-side SERIALIZE_SIZE/DESERIALIZE_SIZE metrics (engine/packages/util/src/metrics.rs). Labels (format, location) are bounded/code-defined, consistent with the metrics cardinality rules in CLAUDE.md. crate::time::Instant is used correctly for wasm compatibility, and rivet_metrics is already an unconditional dependency of this crate (see metrics_endpoint.rs), so no new wasm-compat risk.
Findings
Inconsistent instrumentation coverage in http.rs.decode_http_action_args/encode_http_action_response are wrapped with serde_metrics::measure_*, but the structurally identical queue counterparts, decode_http_queue_request (registry/http.rs:878) and encode_http_queue_response (registry/http.rs:957), are left uninstrumented. If the goal is observability into serde hot paths, the queue send/response path is a real gap, not just a style inconsistency, worth wrapping in the same change or filing a follow-up.
No test coverage for the new module.serde_metrics.rs has no accompanying tests, even though this crate already has an established pattern for exactly this kind of thing in tests/metrics.rs (e.g. duplicate_metric_registration_uses_noop_fallback, actor_startup_duration_metrics_render, which render global metrics and assert on labeled values). A similar test asserting rivetkit_serialize_size/rivetkit_deserialize_size/*_duration_seconds get recorded with the right format/location labels (and that failed deserialization still records size) would catch label typos and regressions.
Minor doc nit: the module doc says it "mirror[s] the engine-side serde observability," but the engine side (engine/packages/util/src/metrics.rs) only has SERIALIZE_SIZE/DESERIALIZE_SIZE (size only, no duration histograms). Not a blocker, just slightly overstates the parity.
PR title includes [SLOP(claude-opus-4-8)]. Per CLAUDE.md, commit/PR titles must be pure conventional commits with no agent/model markers. Worth stripping before merge if this was not intentional tooling metadata.
Nothing else stood out. The closures in decode_http_action_args/encode_http_action_response correctly preserve existing error propagation via ?, persist.rs callers all pass static bounded label strings (no unbounded cardinality), and hard-tab formatting is intact.
NathanFlurry
changed the title
[SLOP(claude-opus-4-8)] feat(rivetkit-core): add serde duration and size metrics
feat(rivetkit-core): add serde duration and size metrics
Jun 26, 2026
MasterPtato
changed the title
feat(rivetkit-core): add serde duration and size metrics
[SLOP(claude-opus-4-8)] feat(rivetkit-core): add serde duration and size metrics
Jun 29, 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
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.
No description provided.