-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[receiver/kubeletstats] Move receiver.kubeletstats.enableCPUUsageMetrics feature gate to beta #39488
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/kubeletstats] Move receiver.kubeletstats.enableCPUUsageMetrics feature gate to beta #39488
Conversation
@@ -57,6 +57,31 @@ func newKubeletScraper( | |||
metricsConfig metadata.MetricsBuilderConfig, | |||
nodeName string, | |||
) (scraper.Metrics, error) { | |||
if EnableCPUUsageMetrics.IsEnabled() { |
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 logic was moved to scraper due to easier testability -> all tests are using newKubeletScraper()
function to initialize the scraper and test the exported metrics and therefore if the logic is present in the factory, there is no possibility to test the new behavior.
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.
How about moving this check to the config validation?
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.
We dont want to do that bc the result of the gate may change the config and generally it is a bad practice to modify the config in the validate function
metricsConfig.Metrics.ContainerCPUUtilization.Enabled = true
metricsConfig.Metrics.K8sPodCPUUtilization.Enabled = true
metricsConfig.Metrics.K8sNodeCPUUtilization.Enabled = true
…ics feature gate to beta Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
38cd820
to
48a4719
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! Thank's @odubajDT!
@@ -57,6 +57,31 @@ func newKubeletScraper( | |||
metricsConfig metadata.MetricsBuilderConfig, | |||
nodeName string, | |||
) (scraper.Metrics, error) { | |||
if EnableCPUUsageMetrics.IsEnabled() { |
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.
How about moving this check to the config validation?
Link to tracking issue
Fixes #39487
Related to #27885