func RegisterMetrics() {
	legacyregistry.MustRegister(vsphereAPIMetric)
	legacyregistry.MustRegister(vsphereAPIErrorMetric)
	legacyregistry.MustRegister(vsphereOperationMetric)
	legacyregistry.MustRegister(vsphereOperationErrorMetric)
	legacyregistry.CustomMustRegister(vCenterMetric)
}
RegisterMetrics registers all the API and Operation metrics
package vclib
import (
	"sync"
	"time"
	"github.com/vmware/govmomi/vim25/types"
	"k8s.io/component-base/metrics"
	"k8s.io/component-base/metrics/legacyregistry"
)
const (
	APICreateVolume = "CreateVolume"
	APIDeleteVolume = "DeleteVolume"
	APIAttachVolume = "AttachVolume"
	APIDetachVolume = "DetachVolume"
)
const (
	OperationDeleteVolume                  = "DeleteVolumeOperation"
	OperationAttachVolume                  = "AttachVolumeOperation"
	OperationDetachVolume                  = "DetachVolumeOperation"
	OperationDiskIsAttached                = "DiskIsAttachedOperation"
	OperationDisksAreAttached              = "DisksAreAttachedOperation"
	OperationCreateVolume                  = "CreateVolumeOperation"
	OperationCreateVolumeWithPolicy        = "CreateVolumeWithPolicyOperation"
	OperationCreateVolumeWithRawVSANPolicy = "CreateVolumeWithRawVSANPolicyOperation"
)
var vCenterMetric *vcenterMetric
func init() {
	vCenterMetric = &vcenterMetric{
		vCenterInfos: make(map[string]types.AboutInfo),
		mux:          sync.Mutex{},
	}
}
var vsphereAPIMetric = metrics.NewHistogramVec(
	&metrics.HistogramOpts{
		Name:           "cloudprovider_vsphere_api_request_duration_seconds",
		Help:           "Latency of vsphere api call",
		StabilityLevel: metrics.ALPHA,
	},
	[]string{"request"},
)
var vsphereAPIErrorMetric = metrics.NewCounterVec(
	&metrics.CounterOpts{
		Name:           "cloudprovider_vsphere_api_request_errors",
		Help:           "vsphere Api errors",
		StabilityLevel: metrics.ALPHA,
	},
	[]string{"request"},
)
var vsphereOperationMetric = metrics.NewHistogramVec(
	&metrics.HistogramOpts{
		Name:           "cloudprovider_vsphere_operation_duration_seconds",
		Help:           "Latency of vsphere operation call",
		StabilityLevel: metrics.ALPHA,
	},
	[]string{"operation"},
)
var vsphereOperationErrorMetric = metrics.NewCounterVec(
	&metrics.CounterOpts{
		Name:           "cloudprovider_vsphere_operation_errors",
		Help:           "vsphere operation errors",
		StabilityLevel: metrics.ALPHA,
	},
	[]string{"operation"},
)
var vsphereVersion = metrics.NewDesc(
	"cloudprovider_vsphere_vcenter_versions",
	"Versions for connected vSphere vCenters",
	[]string{"hostname", "version", "build"}, nil,
	metrics.ALPHA, "")