-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Metricbeat][Kubernetes] Update kube state metrics fetched metrics #34448
Conversation
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
@constanca-m great! So it's just 10 fields that need removal. Go on to remove them. One thing we should consider is searching for fields that are marked as Deprecated. I can see 2
But we are not collecting them, so it is fine. I believe that in next major (ksm version 3) will be completely removed. |
Maybe we will have to remove more fields, because we don't check for labels with that test. I will check if any of the labels we have are unique to the metrics we need to remove. |
Just to give an example. If we add a new field
So we know that something changed when versions were updated. |
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
metricbeat/module/kubernetes/state_cronjob/_meta/testdata/ksm.v2.4.2.plain
Show resolved
Hide resolved
metricbeat/module/kubernetes/state_deployment/state_deployment_test.go
Outdated
Show resolved
Hide resolved
Yes there is no point in that. we should check for fields marked as deprecated and only in case some metricset collects them we should have a warning |
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
So this test will catch cases where let's say we support ksm versions 2.8, 2.9 and 3.0, and there is a filed the we use but was removed in 3.0. It won't be present in all files. That should indicate us that it has maybe been substituted with another field and we need to start collecting it. If we ignore the warning, then when we will start supporting versions 3.0, 3.1, 3.2 the tests will fail because the filed won't be present in any file. |
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.
Please check the linter before merging, I think it is a valid comment
Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
…34448) * Remove deprecated metrics Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
What does this PR do?
How to test this PR locally
go test .
Results prior to removing metrics
These results are from the new function. It highlights the metrics that are no longer present in any of the files. It does not check for labels, since they do not always appear (e.g. if the metric holds no value, then we have no access to the labels).
State container:
State node:
All other state metricsets don't use deprecated metrics.
Results post deleting those metrics
All tests should pass.
Related issues
Relates to #34313.