Add source type label to chunk size metric (#4543)
Lint / golangci-lint (push) Waiting to run
Lint / semgrep (push) Waiting to run
Release / Release (push) Waiting to run
Scan for secrets / test (push) Waiting to run
Test / test (push) Waiting to run
Test / test-community (push) Waiting to run

We're tracking chunk size - but not by source type, which means we can't use the metric to locate potential chunking anomalies by source type. It's really easy to add a source type label, so I did.
This commit is contained in:
Cody Rose
2025-11-05 09:24:37 -05:00
committed by GitHub
parent 75056d9f73
commit f15cb8b37b
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -832,7 +832,7 @@ func (e *Engine) scannerWorker(ctx context.Context) {
dataSize := float64(len(chunk.Data))
scanBytesPerChunk.Observe(dataSize)
scanBytesPerChunk.WithLabelValues(chunk.SourceType.String()).Observe(dataSize)
jobBytesScanned.WithLabelValues(
chunk.SourceType.String(),
chunk.SourceName,
+4 -2
View File
@@ -55,13 +55,15 @@ var (
[]string{"source_type", "source_name"},
)
scanBytesPerChunk = promauto.NewHistogram(prometheus.HistogramOpts{
scanBytesPerChunk = promauto.NewHistogramVec(prometheus.HistogramOpts{
Namespace: common.MetricsNamespace,
Subsystem: common.MetricsSubsystem,
Name: "scan_bytes_per_chunk",
Help: "Total number of bytes in a chunk.",
Buckets: prometheus.ExponentialBuckets(1, 2, 18),
})
},
[]string{"source_type"},
)
jobChunksScanned = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: common.MetricsNamespace,