fix(metrics): resolve name collisions, add missing prefixes, fix typo…#2237
Conversation
Review Summary by QodoFix metric collisions, add prefixes, wire optimizer QoS to smart router
WalkthroughsDescription• Resolve metric name collisions by adding consumer/provider prefixes - Rename lava_latest_block → lava_consumer_latest_block / lava_provider_latest_block - Rename virtual_epoch → lava_consumer_virtual_epoch / lava_provider_virtual_epoch - Add missing lava_consumer_ prefix to 4 metrics • Fix label typo: dissconectReason → disconnectReason • Implement StartSelectionStatsUpdater in SmartRouterMetricsManager - Periodically writes optimizer QoS reports to metrics - Prevents silent no-op that dropped optimizer-sampled scores • Remove unused provider selection score gauges from consumer metrics • Wire OptimizerQoSClient through SmartRouterMetricsManagerOptions Diagramflowchart LR
A["Metric Name Collisions"] -->|"Add prefixes"| B["Consumer/Provider Metrics"]
C["Unused Score Gauges"] -->|"Remove"| D["Cleaner Consumer Metrics"]
E["OptimizerQoSClient"] -->|"Pass via Options"| F["SmartRouterMetricsManager"]
F -->|"Implement Updater"| G["Periodic QoS Score Updates"]
H["Label Typo"] -->|"Fix"| I["Correct disconnectReason"]
File Changes1. protocol/metrics/consumer_metrics_manager.go
|
Code Review by Qodo
1. Non-positive ticker panics
|
e64f292 to
6898996
Compare
avitenzer
left a comment
There was a problem hiding this comment.
Label rename dissconectReason → disconnectReason
…, and wire optimizer QoS to smart router - Rename lava_latest_block → lava_consumer_latest_block / lava_provider_latest_block - Rename virtual_epoch → lava_consumer_virtual_epoch / lava_provider_virtual_epoch - Add missing lava_consumer_ prefix to 4 metrics: relay_processing_latency_before/after_provider, requests_per_provider, protocol_errors_per_provider - Fix label typo: dissconectReason → disconnectReason - Implement StartSelectionStatsUpdater in SmartRouterMetricsManager so optimizer QoS reports are periodically written to lava_rpc_endpoint_selection_score; previously a silent no-op caused all optimizer-sampled scores to be dropped - Pass OptimizerQoSClient via SmartRouterMetricsManagerOptions and simplify call site in rpcsmartrouter.go Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6898996 to
59f5951
Compare
User description
…, and wire optimizer QoS to smart router
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!in the type prefix if API or client breaking changemainbranchReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Align the consumer/provider metrics naming by adding the
lava_consumer_/lava_provider_prefixes, correcting thedisconnectReasonlabel typo, and consistently invokingSetWsSubscriptionDisconnectRequestMetricfrom websocket managers. Wire the optimizer QoS client intoSmartRouterMetricsManagersoStartSelectionStatsUpdaterperiodically streams selection scores intolava_rpc_endpoint_selection_scoreduring smart router startup.ConsumerMetricsManagerandProviderMetricsManager, fix thedisconnectReasonlabel, and ensure websocket disconnect counters route throughSetWsSubscriptionDisconnectRequestMetricconsistently.Modified files (5)
Latest Contributors(2)
OptimizerQoSClientintoSmartRouterMetricsManagerOptions, invokingStartSelectionStatsUpdaterfrom the smart router start-up, and streaming periodic reports intolava_rpc_endpoint_selection_score.Modified files (2)
Latest Contributors(2)