add trace log to track event size expansion#49
add trace log to track event size expansion#49kaisecheng merged 6 commits intologstash-plugins:mainfrom
Conversation
donoghuc
left a comment
There was a problem hiding this comment.
I think this will be helpful. I wonder if there is a similar log message we should add pre split detailing that we are going to be attempting to split into splits.size events. That way if there is a OOM or something during inflation we would have a log message indicating that the split is being attempted?
Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com>
|
@donoghuc Thanks for your considerate suggestion. I have updated the log message and removed an overly verbose debug entry that didn’t add much value. Please have a look. |
| event_target = @target.nil? ? @field : @target | ||
|
|
||
| split_bytes = 0 | ||
| logger.trace? && logger.trace("Event being split into #{splits.size} events") |
There was a problem hiding this comment.
Just out of curiosity... Why are we guarding this with logger.trace? I get it for the other computations as they are somewhat expensive. If i understand correctly, the logging library will handle which messages to actually emit based on level. For example, a message sent with logger.trace('foo') would only ever show up in logs when the trace level logging is configured.
There was a problem hiding this comment.
I guard it to prevent paying the cost of string concatenation string + #{splits.size} + string that is not used in other info or debug level.
There was a problem hiding this comment.
I guard it to prevent paying the cost of string concatenation string + #{splits.size} + string that is not used in other info or debug level.
tested the following pipeline
bin/logstash -f split.conf --log.level tracelog