Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split logs to accommodate exporter limitations #37455

Open
brandonbirdj opened this issue Jan 23, 2025 · 1 comment
Open

Split logs to accommodate exporter limitations #37455

brandonbirdj opened this issue Jan 23, 2025 · 1 comment
Labels
question Further information is requested

Comments

@brandonbirdj
Copy link

Component(s)

No response

Describe the issue you're reporting

Some exporters have different log entry size limits. Google Cloud Logging has a limit of 256KB and will issue the following error when breached.

Error

rpc error: code = InvalidArgument desc = Log entry with size 388.3K exceeds maximum size of 256.0K
error details: name = Unknown  desc = log_entry_errors:{key:16 value:{code:3 message:"Log entry with size 388.3K exceeds maximum size of 256.0K"}} log_entry_errors:{key:17 value:{code:3 message:"Log entry with size 323.0K exceeds maximum size of 256.0K"}}

To get around this error it's possible to use the filelogreceiver to split the log lines.

exporters:
  googlecloud:
    log: {}

receivers:
  filelog:
    include_file_path: true
    include:
      - /var/log/pods/*/*/*.log
    operators:
      - id: container-parser
        type: container
        max_log_size: 250KiB #limited for googlecloud logging exporter

service:
  pipelines:
    logs/googlecloud:
      exporters:
      - googlecloud #has 256 KiB log entry limit
      receivers:
      - filelog

However, there are many other receiver types which don't have the capability to split logs. The OTLP receiver allows setting max_recv_msg_size_mib however that would cause the log to simply not be sent, and doesn't allow for splitting.

exporters:
  debug:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: ":4317"

service:
  pipelines:
    logs:
      exporters:
      - debug
      receivers:
      - otlp

One additional use-case could be using two exporters which allow for different sized logs. In the following example the smaller exporter googlecloud requires the logs be cut smaller than the the googlecloudpubsub exporter.

exporters:
  googlecloud:
    log: {}
  googlecloudpubsub:
    project: "${env:GOOGLE_PROJECT_ID}"
    topic: "projects/${env:GOOGLE_PROJECT_ID}/topics/my-topic"

receivers:
  filelog:
    include_file_path: true
    include:
      - /var/log/pods/*/*/*.log
    operators:
      - id: container-parser
        type: container
        max_log_size: 250KiB #limited for googlecloud logging exporter

service:
  extensions:
  - health_check
  pipelines:
    logs/googlecloud:
      exporters:
      - googlecloud #has 256 KiB log entry limit
      - googlecloudpubsub #has 10MiB limit, though can be compressed also
      receivers:
      - filelog
@brandonbirdj brandonbirdj added the needs triage New item requiring triage label Jan 23, 2025
@atoulme atoulme changed the title Split logs to accomidate exporter limitations Split logs to accommodate exporter limitations Jan 23, 2025
@atoulme
Copy link
Contributor

atoulme commented Jan 23, 2025

@atoulme atoulme added question Further information is requested and removed needs triage New item requiring triage labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants