work on flags
This commit is contained in:
@@ -5,10 +5,11 @@ import (
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"git.k-space.ee/k-space/logmower-shipper/pkg/globals"
|
||||
m "git.k-space.ee/k-space/logmower-shipper/pkg/mongo"
|
||||
)
|
||||
|
||||
var BufferLimitBytes int
|
||||
|
||||
type (
|
||||
RawC <-chan Raw
|
||||
Raw struct {
|
||||
@@ -87,9 +88,9 @@ func (lines singleLines) process(ctx context.Context, parsed chan<- m.Record) {
|
||||
|
||||
buffer = append(buffer, line.B...)
|
||||
|
||||
if len(buffer) > globals.BufferLimitBytes {
|
||||
if len(buffer) > BufferLimitBytes && BufferLimitBytes != 0 {
|
||||
promRecordDroppedTooLarge.WithLabelValues(line.MetricsName).Add(1)
|
||||
log.Printf("dropped record: size in bytes exceeds limit of %d", globals.BufferLimitBytes)
|
||||
log.Printf("dropped record: size in bytes exceeds limit of %d", BufferLimitBytes)
|
||||
|
||||
buffer = nil
|
||||
continue
|
||||
|
Reference in New Issue
Block a user