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

Add allow skip pri otion to syslog. #30869

Merged

Conversation

haimrubinstein
Copy link
Contributor

@haimrubinstein haimrubinstein commented Jan 30, 2024

Description: Currently syslog parser (and receiver) are enforcing a pri header at the beginning of each syslog message. This behavior is incorrect since syslog RFC doesn't require a pri header.

to fix this I added a new 'allow_skip_pri_header' (default false) to syslog config to allow users to choose if they want to allow the parser to skip the pri existence validation.

the main issue was that the syslog parser is using influxdata/go-syslog library which unfortunately is not maintained anymore (according to the repo PR history).

we had a couple of options to fix it and after a long discussion here we have decided to move to a new forked repo.

so I forked the repo, made the necessary changes and updated the syslog parser to start using the new repo.

after that, I ran: make goproto, make crosslink, make -j8 gotidy.
and as a result many files (mostly go.mod and go.sum) files changed.

Link to tracking Issue: #30397

Testing: Manual testing for both RFC 3164 and 5424 with and without pri header.

@andrzej-stencel
Copy link
Member

Thanks! Just a couple of nits.

@haimrubinstein
Copy link
Contributor Author

Thanks! Just a couple of nits.

thanks @astencel-sumo
fixed the nits :)

Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Haim! 🚀

@haimrubinstein
Copy link
Contributor Author

haimrubinstein commented Feb 8, 2024

@djaglowski @astencel-sumo

sorry to bother you, but the unit test seems to be unstable. during the last couple of days, I pushed many changes, sometimes the build failed, and sometimes it passed.
https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7834950902/job/21379397429?pr=30869
the failure seems not related to my PR:

2024/02/08 19:40:51 http: TLS handshake error from 127.0.0.1:45774: remote error: tls: bad certificate

2024/02/08 19:40:51 http: TLS handshake error from 127.0.0.1:45776: write tcp 127.0.0.1:43581->127.0.0.1:45776: use of closed network connection

@djaglowski
Copy link
Member

A PR was just merged to roll back a the change that caused the test failures. I've just updated this PR so it should pass now.

@haimrubinstein
Copy link
Contributor Author

A PR was just merged to roll back a the change that caused the test failures. I've just updated this PR so it should pass now.

thanks!

@djaglowski djaglowski merged commit dab7d3f into open-telemetry:main Feb 8, 2024
156 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 8, 2024
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
**Description:** Currently syslog parser (and receiver) are enforcing a
pri header at the beginning of each syslog message. This behavior is
incorrect since syslog RFC doesn't require a pri header.

to fix this I added a new 'allow_skip_pri_header' (default false) to
syslog config to allow users to choose if they want to allow the parser
to skip the pri existence validation.

the main issue was that the syslog parser is using influxdata/go-syslog
library which unfortunately is not maintained anymore (according to the
repo PR history).

we had a couple of options to fix it and after a long discussion
[here](open-telemetry#30397)
we have decided to move to a new forked repo.

so I forked the repo, made the necessary changes and updated the syslog
parser to start using the new repo.

after that, I ran:  make goproto, make crosslink, make -j8 gotidy.
and as a result many files (mostly go.mod and go.sum) files changed.


**Link to tracking Issue:**
open-telemetry#30397

**Testing:** Manual testing for both RFC 3164 and 5424 with and without
pri header.

---------

Co-authored-by: Andrzej Stencel <astencel@sumologic.com>
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
LokeshOpsramp pushed a commit to opsramp/opentelemetry-collector-contrib that referenced this pull request May 5, 2024
**Description:** Currently syslog parser (and receiver) are enforcing a
pri header at the beginning of each syslog message. This behavior is
incorrect since syslog RFC doesn't require a pri header.

to fix this I added a new 'allow_skip_pri_header' (default false) to
syslog config to allow users to choose if they want to allow the parser
to skip the pri existence validation.

the main issue was that the syslog parser is using influxdata/go-syslog
library which unfortunately is not maintained anymore (according to the
repo PR history).

we had a couple of options to fix it and after a long discussion
[here](open-telemetry#30397)
we have decided to move to a new forked repo.

so I forked the repo, made the necessary changes and updated the syslog
parser to start using the new repo.

after that, I ran:  make goproto, make crosslink, make -j8 gotidy.
and as a result many files (mostly go.mod and go.sum) files changed.

**Link to tracking Issue:**
open-telemetry#30397

**Testing:** Manual testing for both RFC 3164 and 5424 with and without
pri header.

---------

Co-authored-by: Andrzej Stencel <astencel@sumologic.com>
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants