From 3e7e45e787a09b2b4f934a97aa1e1ce094d218b0 Mon Sep 17 00:00:00 2001 From: Viacheslav Gonkivskyi Date: Wed, 31 Jan 2024 18:43:57 +0200 Subject: [PATCH] fix test --- sync/metrics.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sync/metrics.go b/sync/metrics.go index eca2e9c0..e2d75024 100644 --- a/sync/metrics.go +++ b/sync/metrics.go @@ -166,11 +166,13 @@ func (m *metrics) subjectiveInitialization(ctx context.Context) { } func (m *metrics) getRangeRequestTime(ctx context.Context, duration time.Duration, amount int, failed bool) { - m.requestRangeTimeHist.Record(ctx, duration.Seconds(), - metric.WithAttributes( - attribute.Int("headers amount", amount), - attribute.Bool("request failed", failed), - )) + m.observe(ctx, func(ctx context.Context) { + m.requestRangeTimeHist.Record(ctx, duration.Seconds(), + metric.WithAttributes( + attribute.Int("headers amount", amount), + attribute.Bool("request failed", failed), + )) + }) } func (m *metrics) newSubjectiveHead(ctx context.Context, height uint64, timestamp time.Time) {