-
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
Fixes to metricbeat's KVM module #7793
Conversation
bd91665
to
e0fbb1f
Compare
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.
LGTM, just a comment about the changelog entry
CHANGELOG.asciidoc
Outdated
@@ -21,6 +21,8 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] | |||
|
|||
*Metricbeat* | |||
|
|||
- Fixed a panic when the kvm module cannot establish a connection to libvirtd. {issue}7792[7792]. |
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.
Is it a breaking change?
@@ -2,7 +2,10 @@ | |||
metricsets: ["dommemstat"] | |||
enabled: true | |||
period: 10s | |||
hosts: ["localhost"] | |||
hosts: ["unix:///var/run/libvirt/libvirt-sock"] | |||
# for remote hosts, setup network access in libvirtd.conf |
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.
s/for/For/
hosts: ["localhost"] | ||
hosts: ["unix:///var/run/libvirt/libvirt-sock"] | ||
# for remote hosts, setup network access in libvirtd.conf | ||
# and use the tcp schema: |
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.
s/schema/scheme/
, right?
} | ||
|
||
if len(gotDomainMemoryStats) == 0 { | ||
report.Error(errors.New("no domain memory stats found")) | ||
report.Error(fmt.Errorf("no memory stats for domain %s", d.Name)) |
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.
Personally I'd prefer errors.Errorf over fmt.Errorf in case we decide to consume the available stack information that it adds to the error.
Improper error handling caused a panic when connection to libvirtd couldn't be stablished. Cleaned up error handling a little bit. Fixes elastic#7792
The default settings for the kvm module didn't work. Updated to connect to the unix socket by default, and provide a hint on how to setup access to libvirtd running on remote hosts.
Test failure doesn't seem related. |
Improper error handling caused a panic when connection to libvirtd couldn't be stablished. Cleaned up error handling a little bit. Fixes elastic#7792 The default settings for the kvm module didn't work. Updated to connect to the unix socket by default, and provide a hint on how to setup access to libvirtd running on remote hosts. (cherry picked from commit 76d3949)
Improper error handling caused a panic when connection to libvirtd couldn't be stablished. Cleaned up error handling a little bit. Fixes elastic#7792 The default settings for the kvm module didn't work. Updated to connect to the unix socket by default, and provide a hint on how to setup access to libvirtd running on remote hosts. (cherry picked from commit 76d3949)
Improper error handling caused a panic when connection to libvirtd couldn't be stablished. Cleaned up error handling a little bit. Fixes #7792 The default settings for the kvm module didn't work. Updated to connect to the unix socket by default, and provide a hint on how to setup access to libvirtd running on remote hosts. Co-authored-by: Adrian Serrano <[email protected]> (cherry picked from commit 76d3949)
Improper error handling caused a panic when connection to libvirtd couldn't be stablished. Cleaned up error handling a little bit. Fixes #7792 The default settings for the kvm module didn't work. Updated to connect to the unix socket by default, and provide a hint on how to setup access to libvirtd running on remote hosts. Co-authored-by: Adrian Serrano <[email protected]> (cherry picked from commit 76d3949)
Improper error handling caused a panic when connection to libvirtd couldn't be stablished. Cleaned up error handling a little bit. Fixes elastic#7792 The default settings for the kvm module didn't work. Updated to connect to the unix socket by default, and provide a hint on how to setup access to libvirtd running on remote hosts. Co-authored-by: Adrian Serrano <[email protected]> (cherry picked from commit 6de03f7)
Some fixes to the kvm module:
host: [ "localhost" ]
results in the module trying to create a network connection without schema. It will always fail with"dial: Unknown network "
.For a default installation of
libvirtd
, the only possible method is to use:host: [ "unix:///var/run/libvirt/libvirt-sock" ]
.Also some gidance is provided for setting up remote monitoring.