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

[receiver/syslog] Migrate config unmarshaling from yaml to mapstructure #13253

Merged

Conversation

djaglowski
Copy link
Member

pkg/stanza historically used yaml for configuration unmarshaling.
The process of migrating to mapstructure was begun long ago but
was never completed. This PR switches syslog's underlying operators
to use mapstructure unmarshaling.

@djaglowski djaglowski added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Aug 11, 2022
pkg/stanza historically used yaml for configuration unmarshaling.
The process of migrating to mapstructure was begun long ago but
was never completed. This PR switches syslog's underlying operators
to use mapstructure unmarshaling.
@djaglowski djaglowski force-pushed the pkg-stanza-syslog-mapstructure branch from 91c49bd to 2d99715 Compare August 12, 2022 14:03
@djaglowski djaglowski marked this pull request as ready for review August 12, 2022 14:36
@djaglowski djaglowski requested a review from a team as a code owner August 12, 2022 14:36
@@ -59,8 +59,8 @@ func NewConfig(operatorID string) *Config {

// Config is the configuration of a tcp input operator.
type Config struct {
helper.InputConfig `yaml:",inline"`
BaseConfig `yaml:",inline"`
helper.InputConfig `mapstructure:",squash" yaml:",inline"`
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to maintain yaml and json tags as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

For now, but I would like to remove them as a separate effort. There will be a bunch of related code that can be pulled out too, so I think a separate PR will make sense.

Copy link
Member

Choose a reason for hiding this comment

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

sure, just checking the long term commitment that we make here.

receiver/syslogreceiver/syslog.go Show resolved Hide resolved
receiver/syslogreceiver/syslog.go Show resolved Hide resolved
@djaglowski djaglowski merged commit dba69bb into open-telemetry:main Aug 12, 2022
@djaglowski djaglowski deleted the pkg-stanza-syslog-mapstructure branch August 12, 2022 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants