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

Regression: filelog receiver no longer reads the last line of a file it it doesn't end with a newline character #26691

Closed
atoulme opened this issue Sep 14, 2023 · 4 comments · Fixed by #26693
Labels
bug Something isn't working receiver/filelog

Comments

@atoulme
Copy link
Contributor

atoulme commented Sep 14, 2023

Component(s)

receiver/filelog

What happened?

Description

When upgrading from 0.84.0 to 0.85.0, our integration test started to fail because the last log record was not consumed in the file.

Steps to Reproduce

See https://github.com/signalfx/splunk-otel-collector/actions/runs/6182103965/job/16794484352?pr=3631 and
the fix: signalfx/splunk-otel-collector@5e3502b

Expected Result

The filelog receiver should continue to ingest files, including the last line if not terminated by an EOL character.
If this change is voluntary, we need to document this change in the filelog receiver documentation and register this as a breaking change.

Actual Result

The filelog receiver ignores the last line of the file if not ending with an EOL.

Collector version

0.85.0

Environment information

Environment

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

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@atoulme atoulme added the bug Something isn't working label Sep 14, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski
Copy link
Member

djaglowski commented Sep 14, 2023

What configuration is being used?

The receiver does not emit a log just because it reaches the end of a file. A log is emitted if either 1) a complete log is read, as defined by the multiline configuration or lack thereof, or 2) the force_flush_period expires.

@crobert-1
Copy link
Member

Configuration is here:

receivers:
  filelog:
    include: ["${env:LOGFILE_PATH}"]
    start_at: beginning
    operators:
      type: syslog_parser
      protocol: rfc3164

exporters:
  otlp:
    endpoint: "${OTLP_ENDPOINT}"
    tls:
      insecure: true

service:
  telemetry:
    logs:
      level: debug
  pipelines:
    logs:
      receivers: [filelog]
      exporters: [otlp]

@djaglowski
Copy link
Member

I confirmed this is due to the flush period not being applied correctly. #26693 fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/filelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants