Skip to content

Find, verify, and analyze leaked credentials

Remove job ID from bytes_scanned and chunks_scanned metrics (#4206)

Cody Rose5581f083b456
diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go
index a743e0b42..67c76370f 100644
--- a/pkg/engine/engine.go
+++ b/pkg/engine/engine.go
@@ -820,13 +820,11 @@ func (e *Engine) scannerWorker(ctx context.Context) {
scanBytesPerChunk.Observe(dataSize)
jobBytesScanned.WithLabelValues(
- strconv.Itoa(int(chunk.JobID)),
chunk.SourceType.String(),
chunk.SourceName,
).Add(dataSize)
chunksScannedLatency.Observe(float64(time.Since(startTime).Microseconds()))
jobChunksScanned.WithLabelValues(
- strconv.Itoa(int(chunk.JobID)),
chunk.SourceType.String(),
chunk.SourceName,
).Inc()
diff --git a/pkg/engine/metrics.go b/pkg/engine/metrics.go
index 353497795..8cded174c 100644
--- a/pkg/engine/metrics.go
+++ b/pkg/engine/metrics.go
@@ -52,7 +52,7 @@ var (
Name: "job_bytes_scanned",
Help: "Total number of bytes scanned for a job.",
},
- []string{"job_id", "source_type", "source_name"},
+ []string{"source_type", "source_name"},
)
scanBytesPerChunk = promauto.NewHistogram(prometheus.HistogramOpts{
@@ -69,7 +69,7 @@ var (
Name: "job_chunks_scanned",
Help: "Total number of chunks scanned for a job.",
},
- []string{"job_id", "source_type", "source_name"},
+ []string{"source_type", "source_name"},
)
detectBytesPerMatch = promauto.NewHistogram(prometheus.HistogramOpts{