Skip to content
Prev Previous commit
fixup! Merge branch 'main' into blockbuilder-use-scheduler
  • Loading branch information
ashwanthgoli committed Dec 4, 2024
commit c5cba680835906d8723542ed7b48a78ddc697727
2 changes: 1 addition & 1 deletion pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -1820,8 +1820,8 @@ func (t *Loki) initBlockBuilder() (services.Service, error) {
return nil, err
}

readerMetrics := partition.NewReaderMetrics(prometheus.DefaultRegisterer)
readerFactory := func(partitionID int32) (partition.Reader, error) {
readerMetrics := partition.NewReaderMetrics(prometheus.DefaultRegisterer)
return partition.NewKafkaReader(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will panic b/c it's creating new clients each time, each which use the same metrics namespacing internally. Instead, we could create a single client which creates cheap copies via a WithPartition(x) -> Self or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it is safe to make copies of kgo.Client. we'd need separate instances of it as we mutate it while setting offset for consumption.

working around this by registering metrics only once 786186a.

t.Cfg.KafkaConfig,
partitionID,
Expand Down
Loading