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

Bug 1775454: virtwhat multiple platform #42

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions text_collectors/virt.sh
Expand Up @@ -18,10 +18,10 @@ rm -f "${v}" || true
touch "${v}"
if [ -x /usr/sbin/virt-what ]
then
platforms="$( virt-what )"
platforms=$(echo $( virt-what ) | tr '\n' ' ')

Choose a reason for hiding this comment

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

Why is this necessary? Testing locally, only removing the quotes around the ${platforms} is necessary.

Choose a reason for hiding this comment

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

Also, how was this manifesting? I wasn't seeing this in the metrics -

count by (type) (max_over_time(cluster:virt_platform_nodes:sum[7d]))

was not showing an imbalance between xen and xen-hvm as I would expect if one of the tags was missing?

Copy link
Author

@pgier pgier Nov 25, 2019

Choose a reason for hiding this comment

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

You're right, this part is probably not necessary, I wasn't sure if the bash for loop would correctly handle newlines.

In the related bug, the textfile collector is failing because of the invalid format of the generated file. So it wasn't collecting the virt_platform metric at all for those nodes.

echo '# HELP virt_platform reports one series per detected virtualization type. If no type is detected, the type is "none".' >>"${v}"
echo '# TYPE virt_platform gauge' >>"${v}"
for platform in "${platforms}"; do
for platform in ${platforms}; do
if [[ -z "${platform}" ]]; then
continue
fi
Expand Down