Auto-generate feature metrics documentation for agent and operator - v2#44715
Merged
joestringer merged 7 commits intocilium:mainfrom Mar 31, 2026
Merged
Conversation
Member
Author
|
/test |
e137b97 to
ef9ebd4
Compare
Member
Author
|
/test |
joestringer
requested changes
Mar 25, 2026
Member
joestringer
left a comment
There was a problem hiding this comment.
Sorry for the delay. One main question for potential deduplication of metrics dump commands, and a couple of nits below. But overall I like the simplification of the update process proposed by this change.
ef9ebd4 to
277bf6e
Compare
Member
Author
|
/test |
1 similar comment
|
/test |
Member
Author
|
/test |
1 similar comment
Member
Author
|
/test |
Introduce the promdump metrics sub-package as a shared place for the logic used to dump feature metrics from both the agent and operator. The helper writes a Prometheus metrics file from a provided gatherer, which lets the feature metrics packages share the file-generation path without duplicating it. Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
Extend the agent and operator feature metrics with a helper that registers their collectors into a Prometheus registry and returns a gatherer. This keeps the dumping logic in promdump generic while letting the feature metrics packages control exactly which collectors are exposed. Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
Add shared hidden Cobra handlers for `metrics dump features` in the agent and operator feature metrics packages. This keeps the dump implementation close to the agent and operator feature metric gatherer construction, while leaving binary-specific CLI registration to follow-up commits. Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
Wire up the hidden dump handler beneath the existing `metrics` command so feature metric generation lives next to `metrics list`. This avoids introducing another top-level command on the operator while keeping the operator-specific CLI wiring isolated to its own commit. Also move the sub-tree command registration from metrics_list.go into metrics.go so the latter remains focused on the `list` subcommand. Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
Add new metrics command to the agent, which is wired up to expose the hidden `metrics dump features` command for documentation regeneration. This has been done to maintain command uniformity with the operator, as per the previous commit. Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
Add documentation make targets and helper scripts to regenerate and check the feature metric reference files for the agent and operator. The update script invokes the hidden `metrics dump features` command and feeds the generated Prometheus output into the Helm feature documentation generator. Note: this has required adding tools/feature-helm-generator to the top-level make target, so the generator is available to the update helper script. Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
This commit adds pkg/metrics/features to the list of directories to inspect for triggering the documentation workflow. This is helpful now the Documentation sub-directory contains build targets to update and check the feature metrics documentation without having to install and run a Cilium cluster. As a result, we can now remove the documentation checks from the IPv4 smoke test workflow. Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
277bf6e to
57856aa
Compare
Member
Author
|
/test |
1 similar comment
|
/test |
Member
Author
|
/ci-l3-l4 |
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.
Following #44114 CI will now fail if feature metric documentation is out of sync. However, as noted, the developer U/X for this is poor.
This PR:
Adds logic to dump feature-metrics directly from the Cilium agent and operator binaries without having to be installed
Adds and integrates new scripts and build targets to Documentation folder so that someone can run
make -C Documentation update-feature-metricsto re-generate the necessary documentation.Integrates checks on these files into the documentation workflow in Github, and removes the manual checking from the IPv4 smoke test workflow.
For the most part, this PR is replicating the existing pattern and logic used to generate
cmdrefdocs.Note: this replaces an older attempt in: #44556