Rework collectors into single vs group, implement CPU vulnerability mitigations collector#29
Draft
erichte-ibm wants to merge 3 commits intomainfrom
Draft
Rework collectors into single vs group, implement CPU vulnerability mitigations collector#29erichte-ibm wants to merge 3 commits intomainfrom
erichte-ibm wants to merge 3 commits intomainfrom
Conversation
Owner
Author
|
This is somewhat out of scope for the original intent of this pull request, (which was to address cpu vuln mitigations) but the work started by this PR may also lead to addressing #20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While attempting to implement a collector for CPU vulnerability mitigations, it became clear that not all tags can be determined at runtime. For example, not all kernel versions have the same list of mitigations; the list will likely grow with each new kernel version. Updating conga to support each of these new mitigations is tedious and would require constant maintenance.
Instead, this PR introduces a new concept of
SingleCollectorversusGroupCollector.A
SingleCollectoris exactly as it sounds, it collects a single resulting value, and it is up to the caller to associate the full tag to the resulting value. For example, theSingleCollectorfor fetching number of CPU cores associates the tag"cpu.cores"with the result of the functioncpu::get_cores() -> Result<CollectorValue, ...>. Note that the function returns a single value in itsResult<..>.A
GroupCollectorinstead expects multiple results, and associates all of the results under one shared tag. TheGroupCollectorfunction instead returns aResult<Vec<(String, CollectorValue)>, ...>. The tuple contains a sub-tag, and the corresponding value.So taking at look at the CPU vuln mitigations, here is the
GroupCollector:and the output looks something like this: