Closed jaymzmac closed 1 year ago
--test
You will note from your output you got no metrics at all. That includes metrics from other resources. Using --test, runs the collection interval only once and does not wait. As the vsphere plugin readme documents, not all resources produce real time metrics and some produce historical metrics which may be delayed.
My suggestion is to run the plugin for up to 35 or so minutes and then see what you get.
If you look at my configuration you will notice that I am excluding all other resource metrics (vm, host, datastore, etc), so it is not surprising that the output is not showing those.
Also, according to the documentation, the vsan summary.* metrics which I have configured the plugin to collect are real time, so I would expect those to work even if using the --test option.
Anyway, I will run the plugin for a while as you suggest and let you know whether any vsan metrics appear.
Still no VSAN metrics being collected after leaving the plugin running for 12 hours.
@gangadharaswamy,
What is missing in this scenario? Does @jaymzmac need to explicitly include the following to collect metrics?
vsan_metric_exclude = [ "" ]
The telegraf process crashes if I include:
vsan_metric_exclude = [ "" ]
or
vsan_metric_exclude = [ ]
Logs:
2023-07-03T09:11:15Z I! [inputs.vsphere] Starting plugin
panic: strconv.ParseInt: parsing "3.0": invalid syntax
goroutine 37 [running]:
github.com/coreos/go-semver/semver.Must(...)
/go/pkg/mod/github.com/coreos/go-semver@v0.3.1/semver/semver.go:65
github.com/coreos/go-semver/semver.New({0xc000b7ca38?, 0x0?})
/go/pkg/mod/github.com/coreos/go-semver@v0.3.1/semver/semver.go:49 +0x45
github.com/influxdata/telegraf/plugins/inputs/vsphere.versionLowerThan({0xc000b7ca38?, 0x100000000000000?}, {0x6e86677, 0x3})
/go/src/github.com/influxdata/telegraf/plugins/inputs/vsphere/vsan.go:499 +0x45
github.com/influxdata/telegraf/plugins/inputs/vsphere.(*Endpoint).collectVsan(0xc00097b200, {0x7b527d8?, 0xc00011c050}, {0x7b77360?, 0xc002649b00})
/go/src/github.com/influxdata/telegraf/plugins/inputs/vsphere/vsan.go:44 +0x85
github.com/influxdata/telegraf/plugins/inputs/vsphere.(*Endpoint).Collect.func1({0x6e89b16?, 0x0?})
/go/src/github.com/influxdata/telegraf/plugins/inputs/vsphere/endpoint.go:962 +0x95
created by github.com/influxdata/telegraf/plugins/inputs/vsphere.(*Endpoint).Collect
/go/src/github.com/influxdata/telegraf/plugins/inputs/vsphere/endpoint.go:958 +0x44a
vCenter API version in my environment is 7.0.3.0. Maybe it's not getting parsed correctly when checking the minimum API version.
vCenter API version in my environment is 7.0.3.0
correct - this is not a valid semantic version. I have put up https://github.com/influxdata/telegraf/pull/13557 which should handle these types of versions. Can you please download the artifacts attached to the above pull request and try vsan_metric_exclude = [ "" ]
together please.
I've tested the artifacts in https://github.com/influxdata/telegraf/pull/13557 and confirmed this fixes the issue and we are able to see the vsan metrics.
Strange thing here is that the log says this:
2023-06-29T09:38:09Z D! [inputs.vsphere] vCenter version is: 7.0.3
So when does that ".0" get added?
7.0.3 is Client.ServiceContent.About.Version (https://github.com/influxdata/telegraf/blob/v1.27.1/plugins/inputs/vsphere/client.go#L295)
7.0.3.0 is Client.ServiceContent.About.ApiVersion (https://github.com/influxdata/telegraf/blob/v1.27.1/plugins/inputs/vsphere/endpoint.go#L467)
Oh, subtle difference indeed ..
@powersj is it really needed to use ApiVersion
instead of Version
for this check? (then we could still use semver...
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.27.1, Debian 11, vSphere 7.0U3
Docker
No response
Steps to reproduce
Expected behavior
VSAN metrics are collected from vCenter.
Actual behavior
No VSAN metrics are collected from vCenter.
Additional info
I have verified that the performance metrics service is enabled for the VSAN cluster and that I can view the VSAN performance metrics directly in vCenter.
I have also tried configuring the telegraf plugin with a user which was admin rights in vCenter, but that didn't help.