-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(xds): Add OVHcloud service discovery to the ScrapeConfig CRD #6689
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(xds): Add OVHcloud service discovery to the ScrapeConfig CRD #6689
Conversation
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
@dongjiang1989 Currently we are still reviewing what all SDs we want to support you can take a look at the design proposal #6634 |
Got it. thanks |
@mviswanathsai can you review? :) |
pkg/prometheus/promcfg.go
Outdated
if config.Service != nil { | ||
configs[i] = append(configs[i], yaml.MapItem{ | ||
Key: "service", | ||
Value: config.Service, |
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.
Value: config.Service, | |
Value: strings.ToLower(config.Service), |
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.
Thanks.
Is it more reasonable to maintain the user-defined capitalization specifications of CRD? 🤔️
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 it more reasonable to maintain the user-defined capitalization specifications of CRD? 🤔️
Not sure to follow here, could you elaborate?
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.
Not sure to follow here, could you elaborate?
For me, remove the enum limit. It's best to keep it vague.
/cc @simonpasquier @slashpai
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.
It's best to keep it vague.
Not sure what you mean but my opinion is, if we can add valuable validation at the operator its best we do that. I'd go a step further and say its best if we can add most of the validations at the API level (i.e, make the API restrictive) and only touch the application level validation when absolutely necessary. e.g, when fetching secrets, etc.
TLDR; If Prometheus is validating for something (at the application level or otherwise) it is best that the operator also validate for at least that. I think @simonpasquier and @slashpai will agree as well.
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
@simonpasquier @mviswanathsai PTAL re-check |
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
// +kubebuilder:validation:Enum=VPS;DedicatedServer | ||
// +optional | ||
Service *OVHService `json:"service,omitempty"` |
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 I read the Prometheus code properly, service is mandatory field.
// +kubebuilder:validation:Enum=VPS;DedicatedServer | |
// +optional | |
Service *OVHService `json:"service,omitempty"` | |
Service OVHService `json:"service"` |
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.
My bad. Got it.
Done.
Signed-off-by: dongjiang1989 <[email protected]>
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.
Thanks!
Description
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.
support OVHCloud xds
see: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ovhcloud_sd_config
Type of change
What type of changes does your code introduce to the Prometheus operator? Put an
x
in the box that apply.CHANGE
(fix or feature that would cause existing functionality to not work as expected)FEATURE
(non-breaking change which adds functionality)BUGFIX
(non-breaking change which fixes an issue)ENHANCEMENT
(non-breaking change which improves existing functionality)NONE
(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Verification
Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.
Changelog entry
Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.