Skip to content

Commit

Permalink
Merge pull request #250 from OlivierCazade/kafka-metrics
Browse files Browse the repository at this point in the history
Added metrics to kafka ingest
  • Loading branch information
OlivierCazade committed Jul 6, 2022
2 parents b350404 + e277183 commit 467e409
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/pipeline/ingest/ingest_kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ func (ingestK *ingestKafka) processLogLines(out chan<- []config.GenericMap) {
if len(records) >= ingestK.batchMaxLength {
log.Debugf("ingestKafka sending %d records, %d entries waiting", len(records), len(ingestK.in))
decoded := ingestK.decoder.Decode(records)
out <- decoded
linesProcessed.Add(float64(len(records)))
queueLength.Set(float64(len(out)))
ingestK.prevRecords = decoded
log.Debugf("prevRecords = %v", ingestK.prevRecords)
records = []interface{}{}
out <- decoded
}
case <-flushRecords.C: // Maximum batch time for each batch
// Process batch of records (if not empty)
Expand All @@ -113,6 +115,8 @@ func (ingestK *ingestKafka) processLogLines(out chan<- []config.GenericMap) {
}
log.Debugf("ingestKafka sending %d records, %d entries waiting", len(records), len(ingestK.in))
decoded := ingestK.decoder.Decode(records)
linesProcessed.Add(float64(len(records)))
queueLength.Set(float64(len(out)))
ingestK.prevRecords = decoded
log.Debugf("prevRecords = %v", ingestK.prevRecords)
out <- decoded
Expand Down

0 comments on commit 467e409

Please sign in to comment.