Add observation and ser/de metrics for serde calls#5320
Conversation
|
Stack for rivet-dev/rivet Current stack:
Dependencies:
Get stack: |
7988eba to
a0c66b8
Compare
|
This PR introduces serde/observability wrapper macros (
macro_rules! json_from_slice {
($value:expr) => {{
let __bind = $value;
// ... records __bind.len() for metrics ...
$crate::observe!(serde_json::from_slice($value)) // BUG: should be from_slice(__bind)
}};
}
The docstring example: /// observe_with!(task(), |dt, location| {
/// if dt > Duration::from_secs(10) { ... }
/// });
...but the actual macro signature is
The doc comment opens a second Rustdoc will treat everything from that
No existing constant covers byte sizes, so a new one (e.g.,
The
|
|
PR Review: Add observation and ser/de metrics for serde calls Good direction overall — centralizing serde calls behind instrumented macros makes it easy to get latency/size distributions across the whole engine without touching each call site individually. The sim.rs removal is clean. A few concrete issues to address: Bug: double evaluation in The Metrics naming: no package prefix (
Cardinality concern: Source-code locations are compile-time bounded, but the two generic histograms ( Copy-pasted doc comments are incorrect ( Three macros have wrong doc headers: Malformed doc block on The doc block has a tab character before "Use Minor: inconsistent location formatting
No issues with the serde call replacements The mechanical replacements throughout gasoline, cache, and api-peer look correct. The |
|
🚅 Deployed to the rivet-pr-5320 environment in rivet-frontend
|
No description provided.