perf: Prometheus recording rules for lz/bridge histogram queries - #1806
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
/opt/ocb/prom-rules/histogram_recording_rules.yml(already deployed on VPS, Prometheus reloaded)rate(lz_message_latency_milliseconds_bucket[24h])andrate(bridge_quote_latency_ms_bucket[24h])in bench YAMLs with pre-computedocb:*:rate24hrecording rulesRoot cause
layerzero-message-latencyandbridge-quote-latencyboth used rawhistogram_quantile(... rate([24h]))queries. These scan the full 24h TSDB block on every worker sweep (every ~5 min), brown-out Prometheus, and cause adjacent recording-rule queries (kusama, kava, juno RPC benches) to abort under the 10s timeout.Fix
Recording rules pre-compute the expensive aggregations every 5 minutes. Query-time cost drops from O(24h scan) to O(1 TSDB lookup).
Test plan
lz_recording(4 rules) andbridge_quote_recording(6 rules)ocb:lz_message_latency_ms_bucket:rate24hreturns data/benchmarkshub shows live data instead of n/a for layerzero and bridge-quote cards🤖 Generated with Claude Code