From 2a91c1f35df8ec73273fc49e29a962f3d42a1cf7 Mon Sep 17 00:00:00 2001 From: ajatprabha Date: Fri, 9 Feb 2024 12:24:16 +0530 Subject: [PATCH 1/2] ci: add support for go 1.22 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6259641..56b7dbf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [1.18.x, 1.19.x, 1.20.x, 1.21.x] + go-version: [1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x] steps: - name: Install Go uses: actions/setup-go@v2 From 069d61af58b78000f30a82e614baf85b1cec50a8 Mon Sep 17 00:00:00 2001 From: ajatprabha Date: Fri, 9 Feb 2024 12:39:45 +0530 Subject: [PATCH 2/2] vet: remove defer used with time.Since --- xkafka/middleware/prometheus/consumer_middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkafka/middleware/prometheus/consumer_middleware.go b/xkafka/middleware/prometheus/consumer_middleware.go index 15c2507..4bbbcc0 100644 --- a/xkafka/middleware/prometheus/consumer_middleware.go +++ b/xkafka/middleware/prometheus/consumer_middleware.go @@ -51,7 +51,7 @@ func ConsumerMiddleware(next xkafka.Handler) xkafka.Handler { return xkafka.HandlerFunc(func(ctx context.Context, m *xkafka.Message) error { startTime := time.Now() - defer consumerLag.WithLabelValues(m.Group, m.Topic, string(m.Partition)). + consumerLag.WithLabelValues(m.Group, m.Topic, string(m.Partition)). Observe(time.Since(m.Timestamp).Seconds()) inflight := consumerInflightMessages.WithLabelValues(m.Group, m.Topic)