Skip to content

Commit 5581f08

Browse files
authored
Remove job ID from bytes_scanned and chunks_scanned metrics (#4206)
We have several metrics that have captured job ID as a dimension. This is, in a strict sense, "wrong" because the cardinality is unbounded, but our job counts have been low enough that we've been able to get away with it. However, recent exploration of a new distributed job technique has caused job counts to substantially increase, and this extra, "incorrect" dimension is now harder to justify. We have been recently seeing some trouble with some of our Prometheus scrapes, and while I haven't drawn a direct connection between that trouble and the increased cardinality, I do know that we don't use the job ID dimension anywhere. We always sum it away! So this commit removes it. We're shouldn't be doing it, we're not using it, and it might be causing problems we're seeing.
1 parent ab1b459 commit 5581f08

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pkg/engine/engine.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,11 @@ func (e *Engine) scannerWorker(ctx context.Context) {
820820

821821
scanBytesPerChunk.Observe(dataSize)
822822
jobBytesScanned.WithLabelValues(
823-
strconv.Itoa(int(chunk.JobID)),
824823
chunk.SourceType.String(),
825824
chunk.SourceName,
826825
).Add(dataSize)
827826
chunksScannedLatency.Observe(float64(time.Since(startTime).Microseconds()))
828827
jobChunksScanned.WithLabelValues(
829-
strconv.Itoa(int(chunk.JobID)),
830828
chunk.SourceType.String(),
831829
chunk.SourceName,
832830
).Inc()

pkg/engine/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var (
5252
Name: "job_bytes_scanned",
5353
Help: "Total number of bytes scanned for a job.",
5454
},
55-
[]string{"job_id", "source_type", "source_name"},
55+
[]string{"source_type", "source_name"},
5656
)
5757

5858
scanBytesPerChunk = promauto.NewHistogram(prometheus.HistogramOpts{
@@ -69,7 +69,7 @@ var (
6969
Name: "job_chunks_scanned",
7070
Help: "Total number of chunks scanned for a job.",
7171
},
72-
[]string{"job_id", "source_type", "source_name"},
72+
[]string{"source_type", "source_name"},
7373
)
7474

7575
detectBytesPerMatch = promauto.NewHistogram(prometheus.HistogramOpts{

0 commit comments

Comments
 (0)