feat(metrics): align provider metrics with lava_provider_ spec#2239
Conversation
Review Summary by QodoAlign provider metrics with lava_provider_ spec and convert to histograms
WalkthroughsDescription• Convert latency metrics from Gauge to HistogramVec for better distribution analysis • Add apiInterface label to block fetch metrics and latest block tracking • Merge relay/errored counters into unified metrics with function labels • Remove consumer QoS metrics from provider side (lava_consumer_QoS) • Simplify metric initialization and constructor signatures • Add comprehensive provider metrics documentation with PromQL examples Diagramflowchart LR
A["Latency Metrics<br/>Gauge → Histogram"] -->|Observe instead of Set| B["Better Distribution<br/>Analysis"]
C["Block Fetch Metrics"] -->|Add apiInterface label| D["Enhanced<br/>Granularity"]
E["Relay/Error Counters"] -->|Merge with function label| F["Unified Metric<br/>Structure"]
G["Consumer QoS Metrics"] -->|Remove from provider| H["Cleaner Scope"]
I["Constructor Params"] -->|Simplify| J["Reduced Complexity"]
B --> K["Provider Metrics<br/>Aligned"]
D --> K
F --> K
H --> K
J --> K
File Changes1. protocol/metrics/provider_metrics.go
|
Code Review by Qodo
1.
|
c190119 to
1a9ed3e
Compare
0b1f54d to
0b65b74
Compare
20130f5 to
2097223
Compare
0084636 to
566cae1
Compare
566cae1 to
e333270
Compare
e333270 to
4391ff2
Compare
4391ff2 to
c8e59d6
Compare
2b2ac61 to
b35b1d8
Compare
3e3b59b to
efc11b1
Compare
efc11b1 to
5833610
Compare
5833610 to
53426c1
Compare
- Add lava_provider_ prefix to all provider metrics - Convert latency metrics to HistogramVec (end_to_end, provider, per_function) - Merge relay/errored counters into single metric with function label - Add apiInterface label to fetch/block metrics and lava_provider_latest_block - Remove lava_consumer_QoS and lava_consumer_qos_metrics from provider side - Update chain_tracker and rpcprovider callers accordingly - Add provider_metrics.md documentation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53426c1 to
e054c06
Compare
User description
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 provider instrumentation with the refreshed
lava_provider_*schema by renaming and augmenting observable metrics, converting latency gauges to histograms, merging relay/error counters, and propagating the new labels through the chain tracker and rpcprovider paths. Supplement provider observability guidance with health and analytics improvements plus resilience documentation that highlights cache signals, endpoint health breakdowns, and failsafe-go adoption considerations.--add-api-method-metricsflag wherever rpcconsumer is started so that the new provider-side instrumentation is authoritative.Modified files (7)
Latest Contributors(2)
lava_provider_*schema, tagging them withapiInterface/function, switching latency counters to histograms, and updating the documentation, chain tracker bindings, and rpcprovider relay recording to match the new schema.Modified files (7)
Latest Contributors(2)
apiInterfacebreakdown hooks, and ensuring consumer/smartrouter servers instantiate the augmentedRelayMetricspayload before emitting cache metrics.Modified files (6)
Latest Contributors(2)
failsafe-go, so stakeholders understand the complexity before introducing policy-based retry/circuit-breaker logic.Modified files (1)
Latest Contributors(0)