Skip to content

Container Parser Log Truncation at 1.6 MB when using multiline log recombination #43982

@MoosaTae

Description

@MoosaTae

Component(s)

pkg/stanza

/pkg/stanza/operator/parser/container

What happened?

Description

Container logs processed by the OpenTelemetry Collector's container parser are being truncated at exactly 1,638,466 bytes (~1.56 MiB) when using multiline log recombination.

Steps to Reproduce

I use this config for log recombine logs multilines but I still found the split log

    receivers:
      filelog:
        include:
          - /var/log/pods/*/*/*.log
        operators:
          - id: container-parser
            type: container
          - id: recombine-multiline
            type: recombine
            combine_field: body
            combine_with: ""
            is_last_entry: body matches "\\n$"
            source_identifier: attributes["log.file.path"]
            max_batch_size: 10000
          - id: trim-trailing-newline
            type: regex_replace
            field: body
            regex: "[\n]+$"
            replace_with: ""
        start_at: end
        max_log_size: 10MiB
        storage: file_storage

Expected Result

It should recombine logs that larger than 1.56 MiB

Actual Result

it just split the logs because of hard limit on this defaultMaxBatchSize of container parser

Collector version

v0.138.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

receivers:
      filelog:
        include:
          - /var/log/pods/*/*/*.log
        operators:
          - id: container-parser
            type: container
          - id: recombine-multiline
            type: recombine
            combine_field: body
            combine_with: ""
            is_last_entry: body matches "\\n$"
            source_identifier: attributes["log.file.path"]
            max_batch_size: 10000
          - id: trim-trailing-newline
            type: regex_replace
            field: body
            regex: "[\n]+$"
            replace_with: ""
        start_at: end
        max_log_size: 10MiB
        storage: file_storage

Log output

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions