Skip to content

Commit d8a4409

Browse files
authored
fix(metrics): correct channel name (#2623)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview Fix metrics channel. <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> -->
1 parent 6d93f12 commit d8a4409

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

block/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
124124
}, labels).With(labelsAndValues...)
125125

126126
// Initialize channel buffer usage gauges
127-
channelNames := []string{"header_in", "data_in", "header_store", "data_store", "retrieve", "da_includer", "tx_notify"}
127+
channelNames := []string{"height_in", "header_store", "data_store", "retrieve", "da_includer", "tx_notify"}
128128
for _, name := range channelNames {
129129
m.ChannelBufferUsage[name] = prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
130130
Namespace: namespace,

block/metrics_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ func TestMetrics(t *testing.T) {
1818
assert.NotNil(t, em.NumTxs)
1919

2020
// Test channel metrics initialization
21-
assert.Len(t, em.ChannelBufferUsage, 7)
22-
assert.NotNil(t, em.ChannelBufferUsage["header_in"])
23-
assert.NotNil(t, em.ChannelBufferUsage["data_in"])
21+
assert.Len(t, em.ChannelBufferUsage, 6)
22+
assert.NotNil(t, em.ChannelBufferUsage["height_in"])
2423
assert.NotNil(t, em.DroppedSignals)
2524

2625
// Test error metrics initialization
@@ -75,6 +74,7 @@ func TestMetrics(t *testing.T) {
7574

7675
// Test maps are initialized
7776
assert.Len(t, em.ChannelBufferUsage, 6)
77+
assert.NotNil(t, em.ChannelBufferUsage["height_in"])
7878
assert.Len(t, em.ErrorsByType, 5)
7979
assert.Len(t, em.OperationDuration, 5)
8080
assert.Len(t, em.StateTransitions, 3)
@@ -176,8 +176,7 @@ func TestMetricsIntegration(t *testing.T) {
176176
em.GoroutineCount.Set(50)
177177

178178
// Test channel metrics
179-
em.ChannelBufferUsage["header_in"].Set(5)
180-
em.ChannelBufferUsage["data_in"].Set(3)
179+
em.ChannelBufferUsage["height_in"].Set(5)
181180

182181
// Test error metrics
183182
em.ErrorsByType["block_production"].Add(1)

0 commit comments

Comments
 (0)