-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat(OTRM): Add validation for otel configuration in the opamp agent #1469
Conversation
289fe7f
to
1c1b448
Compare
1c1b448
to
8fcd639
Compare
@@ -77,7 +77,7 @@ func (c *Config) Unmarshal(component *confmap.Conf) error { | |||
} | |||
|
|||
c.Builder = factory.CreateDefaultConfig() | |||
if err := subComponent.Unmarshal(c.Builder, confmap.WithErrorUnused()); err != nil { |
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.
confmap version was bumped up.
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.
Looks generally good, just a few cosmetic issues 👍
_, errValidate := otelcoltest.LoadConfigAndValidate(p, factories) | ||
if errValidate != nil { | ||
o.logger.Error("Validation Failed... %v", zap.Error(errValidate)) | ||
return fmt.Errorf("cannot validate config named %v", errValidate) |
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.
Is this error formatting correct? Seems like it should be something like Errorf("cannot validate config named %q: %s", name, err)
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.
This is a test which shows the example formatting
https://github.com/SumoLogic/sumologic-otel-collector/pull/1469/files#diff-8c8da29ce13818d83c803112ef661f02f923afe91f5c30f120447ae2204d896fR240
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.
@echlebek does the above example make sense or would you like to see a change in the format?
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 see, that makes sense
ba3300d
to
86e944b
Compare
@echlebek @swiatekm-sumo I'm working with the backend team to finalize a list of components to validate/support in the opamp agent before going GA. I could update this PR or ensure that this list gets updated incrementally before going GA with this. |
86e944b
to
03c40d0
Compare
3b027d5
to
1b615da
Compare
1b615da
to
c65f012
Compare
Add validation for otel configuration in the opamp agent. These changes cover syntax/semantic issues with the configuration. Reverting configuration after a runtime issue is not part of this change.