-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[exporter/syslog] send syslog messages in batches #27799
[exporter/syslog] send syslog messages in batches #27799
Conversation
This changes the behavior of the Syslog exporter to send each batch of syslog messages in a single request (with messages separated by newlines), instead of sending each message in a separate request and closing the connection after each message. This also significantly refactors (and hopefully simplifies) the exporter's code, extracting the code that formats the Syslog messages from the `sender` type into separate `formatter` types. Hopefully this will make the development of this component easier.
c83790a
to
421407a
Compare
According to https://datatracker.ietf.org/doc/html/rfc5426#section-3.1, Messages sent over UDP must be sent separately. > Each syslog UDP datagram MUST contain only one syslog message
I have changed the implementation to only batch messages when using TCP. As correctly pointed out by @kkujawa-sumo (thank you!), when sending over UDP, each message must be sent in a separate request: https://datatracker.ietf.org/doc/html/rfc5426#section-3.1
|
@songy23 anything missing from marking it as |
Added the label, cc @open-telemetry/collector-contrib-maintainer please merge 🙏 |
**Description:** This changes the behavior of the Syslog exporter to send each batch of Syslog messages in a single request (with messages separated by newlines), instead of sending each message in a separate request and closing the connection after each message. The batching only happens when using TCP. For UDP, each syslog message is still sent in a separate request, as defined by [the spec](https://datatracker.ietf.org/doc/html/rfc5426#section-3.1). This also significantly refactors (and hopefully simplifies) the exporter's code, extracting the code that formats the syslog messages from the `sender` type into separate `formatter` types. Hopefully this will make the development of this component easier. **Link to tracking Issue:** - open-telemetry#21244 **Testing:** The unit tests have been updated to reflect the refactored codebase. The integration tests introduced in open-telemetry#27464 are unchanged, as the format of the output messages hasn't changed. **Documentation:** No documentation updates.
**Description:** This changes the behavior of the Syslog exporter to send each batch of Syslog messages in a single request (with messages separated by newlines), instead of sending each message in a separate request and closing the connection after each message. The batching only happens when using TCP. For UDP, each syslog message is still sent in a separate request, as defined by [the spec](https://datatracker.ietf.org/doc/html/rfc5426#section-3.1). This also significantly refactors (and hopefully simplifies) the exporter's code, extracting the code that formats the syslog messages from the `sender` type into separate `formatter` types. Hopefully this will make the development of this component easier. **Link to tracking Issue:** - open-telemetry#21244 **Testing:** The unit tests have been updated to reflect the refactored codebase. The integration tests introduced in open-telemetry#27464 are unchanged, as the format of the output messages hasn't changed. **Documentation:** No documentation updates.
Description:
This changes the behavior of the Syslog exporter to send each batch of Syslog messages in a single request (with messages separated by newlines), instead of sending each message in a separate request and closing the connection after each message.
The batching only happens when using TCP. For UDP, each syslog message is still sent in a separate request, as defined by the spec.
This also significantly refactors (and hopefully simplifies) the exporter's code, extracting the code that formats the syslog messages from the
sender
type into separateformatter
types. Hopefully this will make the development of this component easier.Link to tracking Issue:
Testing:
The unit tests have been updated to reflect the refactored codebase. The integration tests introduced in #27464 are unchanged, as the format of the output messages hasn't changed.
Documentation:
No documentation updates.