Skip to content
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

Refactor metrics doc generator #11467

Closed
wants to merge 1 commit into from

Conversation

avlitman
Copy link
Contributor

@avlitman avlitman commented Mar 7, 2024

What this PR does

This pr refactor the metric doc generator to use a new common lib.
This pr is a follow-up for the monitoring code refactoring work which documented in this proposal: kubevirt/community#219

Before this PR:
The metric doc generator didn't use the operator-observability common library.
After this PR:
The metric doc generator didn't use the common library.

Jira-ticket: https://issues.redhat.com/browse/CNV-30920

Release note

none

Signed-off-by: avlitman <alitman@redhat.com>
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 7, 2024
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jean-edouard for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@avlitman
Copy link
Contributor Author

avlitman commented Mar 7, 2024

@machadovilaca you think we can avoid querying the endpoints once all refactor work is done?

@avlitman
Copy link
Contributor Author

avlitman commented Mar 7, 2024

/retest

1 similar comment
@avlitman
Copy link
Contributor Author

/retest

@@ -140,8 +140,7 @@ ${KUBEVIRT_DIR}/tools/openapispec/openapispec --dump-api-spec-path ${KUBEVIRT_DI
(cd ${KUBEVIRT_DIR}/tools/doc-generator/ && go_build)
(
cd ${KUBEVIRT_DIR}/docs
${KUBEVIRT_DIR}/tools/doc-generator/doc-generator
mv newmetrics.md metrics.md
${KUBEVIRT_DIR}/tools/doc-generator/doc-generator >metrics.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${KUBEVIRT_DIR}/tools/doc-generator/doc-generator >metrics.md
${KUBEVIRT_DIR}/tools/doc-generator/doc-generator > metrics.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this one was fixed by make generate I did use a space in the beginning

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tools/doc-generator/metrics_collector.go

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do wee need to use a metrics collector? can you use the list methods from each component monitoring package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we query the end point and add metrics manually that's why I asked if we can avoid that.

}
}
return ""
return virt_controller.ListMetrics()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's metrics from multiple components, you should maybe use operatormetrics.ListMetrics() directly

All metrics documented here are auto-generated and reflect exactly what is being
exposed. After developing new metrics or changing old ones please regenerate
this document.
`

func main() {
handler := domainstats.Handler(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only used for domainstats metrics, but this will be part of the virt-handler metric listing after the refactor, this code should also be removed IMO, and this PR only merged after that refactor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense to me also to merge only after refactor is done.

Copy link
Contributor Author

@avlitman avlitman Apr 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@machadovilaca The refactor pr's that need to be merged before this one are:
#11184
#11601
#11538
Is there more?

@avlitman
Copy link
Contributor Author

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 11, 2024
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2024
@kubevirt-bot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@avlitman
Copy link
Contributor Author

closed since handle in #11601

@avlitman avlitman closed this Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants