-
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
Refactor prometheusreceiver config to avoid some custom unmarshal work #29901
Conversation
d55ec29
to
b5d929d
Compare
77918ad
to
3558d52
Compare
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.
If this is a breaking change it needs significantly more description of its purpose and effect. What are we trying to do here? Why is it necessary and advisable? What impact does it have on users (both end users and developers of components that interact with this component)? There's no description on this PR nor is there an issue detailing what needs to change and why.
It is an API breaking change because it changes a public type. It isn't a breaking change for users. |
@Aneurysm9 tried to clarify what happens. It is a clear improvement in my opinion since we remove the hacky placeholders. |
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.
Still reviewing this but I'm on-call today and Monday and unlikely to be able to finish a review before Tuesday.
API users are still users. Has this been communicated to @open-telemetry/operator-ta-maintainers? I know they're at least one group that is going to have an interest in this. |
As per my understanding in the changelog we use
I don't see a need to do that, since https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-operator%20prometheusreceiver&type=code doesn't show any usage of the public API. |
3558d52
to
06c5e01
Compare
@Aneurysm9 friendly ping |
6a2ada0
to
8ddccca
Compare
@Aneurysm9 friendly ping |
1 similar comment
@Aneurysm9 friendly ping |
5e618ff
to
8d77098
Compare
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.
Apart from the failing unit tests due to the change in logic in one validation, this looks good.
Out of curiosity: are you doing this change so that you can build a more specialized Prometheus receiver? If so, this might benefit the Pure Storage receivers as well (cc @chrroberts-pure , @dgoscn)
4aaf902
to
0e0b4b2
Compare
For the moment focus on cleaning how we do unmarshal/validation and understand patterns. |
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.
LGTM - left some nits.
return nil | ||
} | ||
// We need custom unmarshaling because prometheus "config" subkey defines its own | ||
// YAML unmarshaling routines so we need to do it explicitly. | ||
cfgMap["url"] = "http://placeholder" // we have to set it as else the marshal will fail |
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.
[Nit]
cfgMap["url"] = "http://placeholder" // we have to set it as else the marshal will fail | |
cfgMap["url"] = "http://placeholder" // we have to set it as else marshalling will fail |
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.
Done.
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 am not a native english speaker, so I will not fight with the linter:
Error: prometheusreceiver/config.go:148:68: `marshalling` is a misspelling of `marshaling` (misspell)
cfgMap["url"] = "http://placeholder" // we have to set it as else marshalling will fail
0e0b4b2
to
d26bfed
Compare
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.
LGTM
I still do not believe that there has been adequate explanation of the purpose or value of these changes or whether they are self-contained or the beginning of a stepwise refactoring to an unstated desired end state. That said, it is not my desire to be an impediment if the maintainers believe that this change must be made.
0e458de
to
ac09ec1
Compare
Points noted @Aneurysm9 Thanks! |
Signed-off-by: Bogdan Drutu <[email protected]>
ac09ec1
to
3d56cf0
Compare
After careful consideration, I am proceeding to merge this PR in my capacity as a @open-telemetry/collector-contrib-maintainer. I would like to outline the reasons for this decision:
|
open-telemetry#29901) This is **NOT** a user config breaking change. This PR improves the usability of our public APIs removing unnecessary placeholders public members. For API developers they only need to interact with the new wrapper types and don't worry about placeholders. Also this PR simplifies the unmarshalling logic allowing to add more fields more confidently. Signed-off-by: Bogdan Drutu <[email protected]>
This is NOT a user config breaking change.
This PR improves the usability of our public APIs removing unnecessary placeholders public members. For API developers they only need to interact with the new wrapper types and don't worry about placeholders.
Also this PR simplifies the unmarshalling logic allowing to add more fields more confidently.