From 8ceb8007fe12b548c301f514a996f9961d9df2b0 Mon Sep 17 00:00:00 2001 From: tdakkota Date: Fri, 13 Oct 2023 06:32:22 +0300 Subject: [PATCH] fix(metricsharding): use right path for attributes --- internal/metricsharding/consumer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/metricsharding/consumer.go b/internal/metricsharding/consumer.go index c378ab7b..ae9e760a 100644 --- a/internal/metricsharding/consumer.go +++ b/internal/metricsharding/consumer.go @@ -81,15 +81,18 @@ func (c *Consumer) insertBatch(ctx context.Context, id TenantID, batch *InsertBa ctx := grpCtx return insertDynamicSlice(ctx, c.yc, activePath.Child("points"), batch.Points) }) + + attributesPath := activePath.Child("attributes") batch.Attributes.Each(func(at time.Time, v []metricstorage.Attributes) { - table := activePath.Child(at.Format(timeBlockLayout)) + table := attributesPath.Child(at.Format(timeBlockLayout)) grp.Go(func() error { ctx := grpCtx return insertDynamicSlice(ctx, c.yc, table, v) }) }) + resourcePath := activePath.Child("resource") batch.Resource.Each(func(at time.Time, v []metricstorage.Resource) { - table := activePath.Child(at.Format(timeBlockLayout)) + table := resourcePath.Child(at.Format(timeBlockLayout)) grp.Go(func() error { ctx := grpCtx return insertDynamicSlice(ctx, c.yc, table, v)