-
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
Fix types for response fields of kubelet api #23335
Conversation
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Pinging @elastic/integrations (Team:Platforms) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
Test | Results |
---|---|
Failed | 0 |
Passed | 2288 |
Skipped | 507 |
Total | 2795 |
Signed-off-by: chrismark <chrismarkou92@gmail.com>
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 good! But we also have to check if we can store these uint64
numbers in ES with current mappings.
@@ -40,7 +40,7 @@ func eventMapping(content []byte, perfMetrics *util.PerfMetricsCache) ([]common. | |||
nodeCores := perfMetrics.NodeCoresAllocatable.Get(node.NodeName) | |||
nodeMem := perfMetrics.NodeMemAllocatable.Get(node.NodeName) | |||
for _, pod := range summary.Pods { | |||
var usageNanoCores, usageMem, availMem, rss, workingSet, pageFaults, majorPageFaults int64 | |||
var usageNanoCores, usageMem, availMem, rss, workingSet, pageFaults, majorPageFaults uint64 |
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 are currently defining these values as long
in fields.yml
(with a minimum value of -2^63 and a maximum value of 2^63-1). We probably need to change the mapping to be able to store big numbers. unsigned_long
is only supported since 7.10, maybe we can use double
for this.
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, thanks for catching this! But does this mean that we can only ship it a new minor release right? Otherwise, with patch releases it might cause mapping conflicts?
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.
Yes, let's backport this only till 7.11.
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
(cherry picked from commit 9b7676f)
(cherry picked from commit 9b7676f)
What does this PR do?
This PR adjusts the types of the response fields from Kubelet
stats/summary
api so as to be consistent with the original types of the fields as defined on api's side: https://github.com/kubernetes/kubelet/blob/088ee84ea259bf9c445109ea75b2938dd39d2074/pkg/apis/stats/v1alpha1/types.goWhy is it important?
To avoid hitting integer overflow since we store as
int64
while the api can serve values stored asuint64
.int64
: -9223372036854775808 to 9223372036854775807uint64
: 0 to 18446744073709551615Closes #19475