-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/syslog] expose the syslog parser config from the syslog receiver #36906
base: main
Are you sure you want to change the base?
[receiver/syslog] expose the syslog parser config from the syslog receiver #36906
Conversation
…eiver The syslog receiver relies on the stanza syslog input. Among other inputs, the syslog input is a bit special because it's a wrapper of a TCP/UDP input with a syslog parser. The user can't configure the syslog parser because it's not exposed from the syslog input config, which means that some useful features like the `on_error` mode or `parse_from/to` is unavailable if you are using syslog receiver. This PR adds the parser config to the syslog input config, under `parser` field. I choose not to flatten it because the existing `InputConfig.WriterConfig` will be conflicted with the `ParserConfig.TransformerConfig.WriterConfig`. We can overrides it later in the `Build` func, but I guess it's a bit implicit and error-prone, therefore I choose to add a new `parser` field. I'm open to change it if the owners think otherwise. This change should be backward-compatible.
https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/12425577954/job/34692561655?pr=36906 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree that there's any reason to expose most of these settings. The only one that makes any sense to me is on_error
because it can provide useful behavior options.
All of the other fields suggested here are for things that instruct the parser where to find things, which is already defined due to the behavior of the tcp and udp inputs.
If you want to customize behavior further, why not use tcp or udp receivers and configure the syslog parser manually?
Hi @djaglowski, thanks for the reply.
If this makes some sense, then is it possible to at least expose this config?
Can you elaborate more on this point? The TCP/UDP inputs didn't really "define" any parser config other than init a default config. I'm also not sure why it would be a bad thing to grant users the power to config the parser.
Yes, I guess we would have to go down that route if this can't happen upstream. However, there is some config that we can't touch from the outside, like setting the opentelemetry-collector-contrib/pkg/stanza/operator/input/syslog/config.go Lines 65 to 67 in f21f718
CMIIW, but it seems we can't really have a 1-1 replication of the syslog receiver by combining TCP/UDP receiver with syslog parser. Lastly, the syslog_input documentation claims that it supports https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/f21f7183cafdb2ec61fbb23692e9ee37b4f871c2/pkg/stanza/docs/operators/syslog_parser.md#configuration-fields, but that's not true since the parser config is not configurable.
I understand that it might be a niche request, but I believe it's a reasonable one(or probably because I needed it 🙊 ). I'm ok with exposing the ones that you think make sense. |
Description
The syslog receiver relies on the stanza syslog input. Among other inputs, the syslog input is a bit special because it's a wrapper of a TCP/UDP input with a syslog parser. The user can't configure the syslog parser because it's not exposed from the syslog input config, which means that some useful features like the
on_error
mode orparse_from/to
is unavailable if you are using syslog receiver.This PR adds the parser config to the syslog input config under the
parser
field. I chose not to flatten it because the existingInputConfig.WriterConfig
will conflict with theParserConfig.TransformerConfig.WriterConfig
. We can override it later in theBuild
func, but I guess it's a bit implicit and error-prone, so I choose to add a newparser
field. I'm open to changing it if the owners think otherwise.This change should be backward-compatible.
Testing
Tested locally with newly added config.
Documentation
Added the parser config documentation to the syslog receiver README.