From 3168f399ac0328baf4a2940285d94cc9223571bb Mon Sep 17 00:00:00 2001 From: Alex Barganier Date: Fri, 3 Feb 2023 13:51:09 -0400 Subject: [PATCH] pkg/util/metric: fix HistogramMode for streamingingest histograms Ref: https://github.com/cockroachdb/cockroach/pull/96514 The above patch migrated all histogram constructors over to use a generic constructor, which has the ability to specify a HistogramMode. While preparing a backport of this patch, I noticed that the following streamingest histograms were incorrectly tagged with a HistogramMode of HistogramModePreferHdrLatency: 1. FlushHistNanos 2. CommitLatency 3. AdmitLatency If you look at the original migration, when HDR was still being used, these histograms were *not* using the HDR latency defaults: https://github.com/cockroachdb/cockroach/commit/a82aa8267b1b33a685a02a0f73ec2ece1f8ba295#diff-1bc5bdba63149e8efeadce17e7eb62bb5cd1dcee22974b37881a627e13c0501dL137-L143 This patch fixes these histograms to no longer incorrectly specify the HistogramModePreferHdrLatency mode in the histogram options. This was also fixed in the backport PR. Release note: none --- pkg/ccl/streamingccl/streamingest/metrics.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/ccl/streamingccl/streamingest/metrics.go b/pkg/ccl/streamingccl/streamingest/metrics.go index c2858cd5ad36..18cba44f8fb1 100644 --- a/pkg/ccl/streamingccl/streamingest/metrics.go +++ b/pkg/ccl/streamingccl/streamingest/metrics.go @@ -155,7 +155,6 @@ func MakeMetrics(histogramWindow time.Duration) metric.Struct { Buckets: metric.BatchProcessLatencyBuckets, MaxVal: streamingFlushHistMaxLatency.Nanoseconds(), SigFigs: 1, - Mode: metric.HistogramModePreferHdrLatency, }), CommitLatency: metric.NewHistogram(metric.HistogramOptions{ Metadata: metaReplicationCommitLatency, @@ -163,7 +162,6 @@ func MakeMetrics(histogramWindow time.Duration) metric.Struct { Buckets: metric.BatchProcessLatencyBuckets, MaxVal: streamingCommitLatencyMaxValue.Nanoseconds(), SigFigs: 1, - Mode: metric.HistogramModePreferHdrLatency, }), AdmitLatency: metric.NewHistogram(metric.HistogramOptions{ Metadata: metaReplicationAdmitLatency, @@ -171,7 +169,6 @@ func MakeMetrics(histogramWindow time.Duration) metric.Struct { Buckets: metric.BatchProcessLatencyBuckets, MaxVal: streamingAdmitLatencyMaxValue.Nanoseconds(), SigFigs: 1, - Mode: metric.HistogramModePreferHdrLatency, }), RunningCount: metric.NewGauge(metaStreamsRunning), EarliestDataCheckpointSpan: metric.NewGauge(metaEarliestDataCheckpointSpan),