influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.91k stars 5.6k forks source link

Implementing VM disk usage and disk provisioned to Telegraf vSphere plugin #11066

Open JannoLepind opened 2 years ago

JannoLepind commented 2 years ago

Feature Request

Current documentation under vSphere plugin states that the metrics should be present but they appear not to be image

vSphere version used; 6.5 In telegraf vsphere-stats.conf;

vm_metric_include = [] host_metric_include = [] cluster_metric_include = [] datastore_metric_exclude = []

Current version of Telegraf does not include any VM disk capacity metrics [1] but are available at vSphere [3]. This would appear to be true at code level as well but i could be wrong [5][6], issue could be that Telegraf uses govmomi VIM25 functions to query data and those just don't include VM disk provisioned/usage data. Solution would be to implement govmomi SMS (storage management system) library to Telegraf, those metrics should be available with vmname going by VDC SMS API documentation [4].

Terminology; VIM Virtualized Infrastructure Manager, SMS Storage Management System

Resources referenced; [1] Telegraf vSphere plugin; https://github.com/influxdata/telegraf/tree/master/plugins/inputs/vsphere [2] Underlying library used to make API calls to vSphere; https://github.com/vmware/govmomi [3] vSphere 6.5 available metrics https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-65-monitoring-performance-guide.pdf [4] VDC SMS API https://vdc-repo.vmware.com/vmwb-repository/dcr-public/28141950-ce92-4e58-9d03-d85d13a72d59/f401aecb-6415-4dfc-88a4-546f5db4528b/doc/result-contextEntity_relationships.html [5] Telegraf vSphere code https://github.com/influxdata/telegraf/blob/master/plugins/inputs/vsphere/vsphere.go

Use case:

These 2 metrics are crucial to set up a proper VM resource utilization monitoring in Grafana for large amount of VM's (dynamic boards).

JannoLepind commented 2 years ago

Ideally all of those metrics could be implemented; image

shredstick commented 2 years ago

This has already been discussed in Issue https://github.com/influxdata/telegraf/issues/5480

JannoLepind commented 2 years ago

Looks like it, yeah - so my input here would be that this could be implemented using govmomi SMS https://github.com/vmware/govmomi/blob/master/sms/types/types.go library as that component is responsible for storage metrics in vSphere

TiagoMHCSantana commented 2 years ago

This feature would be really handy. It's not always possible to have telegraf running inside the VM.

dmgeurts commented 2 years ago

If the vSphere API supports these metrics for VMs running guest tools then why not include this data?