Skip to content

Commit

Permalink
fix(metricsharding): use right path for attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Oct 13, 2023
1 parent 4391a43 commit 8ceb800
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/metricsharding/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ceb800

Please sign in to comment.