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

[pkg/stanza] always register operator to DefaultRegistry. Double chec… #32478

Closed
wants to merge 1 commit into from

Conversation

li-zeyuan
Copy link
Contributor

Description:*
bug: collector launch fail with '--feature-gates=logs.jsonParserArray'

how to fix:

  1. func init()always register operator to operator.DefaultRegistry.
  2. use Gate.operatorType double check operator state in featuregate.globalRegistry when unmarshal configuration. Because id and operatorType are not the same string. (id: "logs.jsonParserArray", operatorType: "json_array_parser")

depend on:open-telemetry/opentelemetry-collector#9983
Link to tracking Issue:
#32313

…k state in featuregate when unmarshal configuration.
@li-zeyuan
Copy link
Contributor Author

Depending on open-telemetry/opentelemetry-collector#9983 merge, the code will fail to build

Comment on lines -29 to -31
if jsonArrayParserFeatureGate.IsEnabled() {
operator.Register(operatorType, func() operator.Builder { return NewConfig() })
}
Copy link
Member

Choose a reason for hiding this comment

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

Please just move this check into the Build function and return an error if it's not enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your review.

@li-zeyuan
Copy link
Contributor Author

@djaglowski
Thank you very much for your answer. I will close MR.

@li-zeyuan li-zeyuan closed this Apr 18, 2024
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

3 participants