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
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user