Skip to content

Commit

Permalink
offsets->offset.
Browse files Browse the repository at this point in the history
  • Loading branch information
seizethedave committed Oct 22, 2024
1 parent 72cbfb6 commit 7ccef62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/blockbuilder/scheduler/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

type schedulerMetrics struct {
updateScheduleDuration prometheus.Histogram
partitionStartOffsets *prometheus.GaugeVec
partitionEndOffsets *prometheus.GaugeVec
partitionStartOffset *prometheus.GaugeVec
partitionEndOffset *prometheus.GaugeVec
}

func newSchedulerMetrics(reg prometheus.Registerer) schedulerMetrics {
Expand All @@ -21,11 +21,11 @@ func newSchedulerMetrics(reg prometheus.Registerer) schedulerMetrics {

NativeHistogramBucketFactor: 1.1,
}),
partitionStartOffsets: promauto.With(reg).NewGaugeVec(prometheus.GaugeOpts{
partitionStartOffset: promauto.With(reg).NewGaugeVec(prometheus.GaugeOpts{
Name: "cortex_blockbuilder_scheduler_partition_start_offset",
Help: "The observed start offset of each partition.",
}, []string{"partition"}),
partitionEndOffsets: promauto.With(reg).NewGaugeVec(prometheus.GaugeOpts{
partitionEndOffset: promauto.With(reg).NewGaugeVec(prometheus.GaugeOpts{
Name: "cortex_blockbuilder_scheduler_partition_end_offset",
Help: "The observed end offset of each partition.",
}, []string{"partition"}),
Expand Down
4 changes: 2 additions & 2 deletions pkg/blockbuilder/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func (s *BlockBuilderScheduler) updateSchedule(ctx context.Context) {
s.metrics.updateScheduleDuration.Observe(time.Since(startTime).Seconds())

startOffsets.Each(func(o kadm.ListedOffset) {
s.metrics.partitionStartOffsets.WithLabelValues(fmt.Sprint(o.Partition)).Set(float64(o.Offset))
s.metrics.partitionStartOffset.WithLabelValues(fmt.Sprint(o.Partition)).Set(float64(o.Offset))
})
endOffsets.Each(func(o kadm.ListedOffset) {
s.metrics.partitionEndOffsets.WithLabelValues(fmt.Sprint(o.Partition)).Set(float64(o.Offset))
s.metrics.partitionEndOffset.WithLabelValues(fmt.Sprint(o.Partition)).Set(float64(o.Offset))
})
}

0 comments on commit 7ccef62

Please sign in to comment.