Project: Longhorn (Runtime / Cloud Native Storage)
File: 20230420-upgrade-checker-info-collection.md

The website https://metrics.longhorn.io/ offers valuable insights into how Longhorn is being utilized, which can be accessed by the public. This information serves as a useful reference for user who are new to Longhorn, as well as those considering upgrading Longhorn or the underlying Kubernetes version. Additionally, it is useful for the Longhorn team to understand how it is being used in the real world. To gain a deeper understanding of usage patterns, it would be beneficial to gather additional information on volumes, host systems, and features. This data would not only offer insights into how to further improve Longhorn but also provide valuable ideas on how to steer Longhorn development in the right direction. This proposal aims to enhance Longhorn's upgrade checker `extraInfo` by collecting additional information includes node and cluster information, and some Longhorn settings. This proposal introduces a new setting, `Allow Collecting Longhorn Usage Metrics`, to allow users to enable or disable the collection. https://github.com/longhorn/longhorn/issues/5235 Extend collections of user cluster info during upgrade check. Have a new setting to provide user with option to enable or disable the collection. `None` Collect and sends through upgrade responder request. Node info: Kernel release OS distro Disk types (HDD, SSD, NVMe) Node provider Cluster info: Longhorn namespace UID for adaption rate Number of nodes Longhorn components CPU and memory usage Volumes info; such as access mode, frontend, average snapshot per volume, etc. Some Longhorn settings Introduce new `Allow Collecting Longhorn Usage Metrics` setting. Users can view how Longhorn is being utilized on https://metrics.longhorn.io/. Additionally, users have the ability to disable the collection by Longhorn. Users can find a list of items that Longhorn collects as extra information in the Longhorn documentation. Users can enable or disable the collection through the `Allow Collecting Longhorn Usage Metrics` setting. This setting can be configured using the UI or through kubectl, similar to other settings. `None` If this value is set to false, extra information will not be collected. Setting definition: ``` DisplayName: "Allow Collecting Longhorn Usage Metrics" Description: "Enabling this setting will allow Longhorn to provide additional usage metrics to https://metrics.longhorn.io. This information will help us better understand how Longhorn is being used, which will ultimately contribute to future improvements." Category: SettingCategoryGeneral Type: SettingTypeBool Required: true ReadOnly: false Default: "true" ``` The following information is sent from each cluster node: Number of disks of different device (`longhornnodedisk<hdd/ssd/nvme/unknown>count`). > Note: this value may not be accurate if the cluster node is a virtual

Host kernel release (`hostkernelrelease`) Host Os distro (`hostosdistro`) Kubernetest node provider (`kubernetesnodeprovider`) The following information is sent from one of the cluster node: Longhorn namespace UID (`longhornnamespaceuid`). Number of nodes (`longhornnodecount`). Number of volumes of different access mode (`longhornvolumeaccessmode<rwo/rwx/unknown>_count`). Number of volumes of different data locality (`longhornvolumedatalocality<disabled/besteffort/strictlocal/unknown>_count`). Number of volumes of different frontend (`longhornvolumefrontend<blockdev/iscsi>count`). Average volume size (`longhornvolumeaverage_size`). Average volume actual size (`longhornvolumeaverageactualsize`). Average number of snapshots per volume (`longhornvolumeaveragesnapshotcount`). Average number of replicas per volume (`longhornvolumeaveragenumberof_replicas`). Average Longhorn component CPU usage (`longhorn<engineimage/instancemanager/manager/ui>averagecpuusage_core`) Average Longhorn component CPU usage (`longhorn<engineimage/instancemanager/manager/ui>averagememoryusage_mib`) Settings (`longhornsetting<name>`): Settings to exclude: SettingNameBackupTargetCredentialSecret SettingNameDefaultEngineImage SettingNameDefaultInstanceManagerImage SettingNameDefaultShareManagerImage SettingNameDefaultBackingImageManagerImage SettingNameSupportBundleManagerImage SettingNameCurrentLonghornVersion SettingNameLatestLonghornVersion SettingNameStableLonghornVersions SettingNameDefaultLonghornStaticStorageClass SettingNameDeletingConfirmationFlag SettingNameDefaultDataPath SettingNameUpgradeChecker SettingNameAllowCollectingLonghornUsage SettingNameDisableReplicaRebuild (deprecated) SettingNameGuaranteedEngineCPU (deprecated) Settings that requires processing to identify their general purpose: SettingNameBackupTarget (the backup target type/protocol, ex: cifs, nfs, s3) Settings that should be collected as boolean (true if configured, false if not): SettingNameTaintToleration SettingNameSystemManagedComponentsNodeSelector SettingNameRegistrySecret SettingNamePriorityClass SettingNameStorageNetwork Other settings that should be collected as it is. Example: ``` name: upgrade_request time appversion hostkernelrelease hostosdistro kubernetesnodeprovider kubernetesversion longhornengineimageaveragecpuusagecore longhornengineimageaveragememoryusagemib longhorninstancemanageraveragecpuusagecore longhorninstancemanageraveragememoryusagemib longhornmanageraveragecpuusagecore longhornmanageraveragememoryusagemib longhornnamespaceuid longhornnodecount longhornnodedisknvmecount longhornsettingallownodedrainwithlasthealthyreplica longhornsettingallowrecurringjobwhilevolumedetached longhornsettingallowvolumecreationwithdegradedavailability longhornsettingautocleanupsystemgeneratedsnapshot longhornsettingautodeletepodwhenvolumedetachedunexpectedly longhornsettingautosalvage longhornsettingbackingimagecleanupwaitinterval longhornsettingbackingimagerecoverywaitinterval longhornsettingbackupcompressionmethod longhornsettingbackupconcurrentlimit longhornsettingbackuptarget longhornsettingbackupstorepollinterval longhornsettingconcurrentautomaticengineupgradepernodelimit longhornsettingconcurrentreplicarebuildpernodelimit longhornsettingconcurrentvolumebackuprestorepernodelimit longhornsettingcrdapiversion longhornsettingcreatedefaultdisklabelednodes longhornsettingdefaultdatalocality longhornsettingdefaultreplicacount longhornsettingdisablerevisioncounter longhornsettingdisableschedulingoncordonednode longhornsettingenginereplicatimeout longhornsettingfailedbackupttl longhornsettingfastreplicarebuildenabled longhornsettingguaranteedenginemanagercpu longhornsettingguaranteedinstancemanagercpu longhornsettingguaranteedreplicamanagercpu longhornsettingkubernetesclusterautoscalerenabled longhornsettingnodedownpoddeletionpolicy longhornsettingnodedrainpolicy longhornsettingorphanautodeletion longhornsettingpriorityclass longhornsettingrecurringfailedjobshistorylimit longhornsettingrecurringsuccessfuljobshistorylimit longhornsettingregistrysecret longhornsettingremovesnapshotsduringfilesystemtrim longhornsettingreplicaautobalance longhornsettingreplicafilesynchttpclienttimeout longhornsettingreplicareplenishmentwaitinterval longhornsettingreplicasoftantiaffinity longhornsettingreplicazonesoftantiaffinity longhornsettingrestoreconcurrentlimit longhornsettingrestorevolumerecurringjobs longhornsettingsnapshotdataintegrity longhornsettingsnapshotdataintegritycronjob longhornsettingsnapshotdataintegrityimmediatecheckaftersnapshotcreation longhornsettingstorageminimalavailablepercentage longhornsettingstoragenetwork longhornsettingstorageoverprovisioningpercentage longhornsettingstoragereservedpercentagefordefaultdisk longhornsettingsupportbundlefailedhistorylimit longhornsettingsystemmanagedcomponentsnodeselector longhornsettingsystemmanagedpodsimagepullpolicy longhornsettingtainttoleration longhornuiaveragecpuusagecore longhornuiaveragememoryusagemib longhornvolumeaccessmoderwocount longhornvolumeaverageactualsize longhornvolumeaveragenumberofreplicas longhornvolumeaveragesize longhornvolumeaveragesnapshotcount longhornvolumedatalocalitydisabledcount longhornvolumefrontendblockdevcount value -- - -- -- - -- -- - - -- -- - -- - -- - -- - - - - -- -- -- -- -- - - - -- - - - - - -- -- -- - - - -- - - -- -- -- -- - - -- - - -- - -- -- -- 1683598256887331729 v1.5.0-dev 5.3.18-59.37-default "sles" k3s v1.23.15+k3s1 5m 11 4m 83 22m 85 1b96b299-b785-468b-ab80-b5b5b12fbe00 3 1 false false true true true true 60 300 lz4 5 none 300 0 5 5 longhorn.io/v1beta2 false disabled 3 false true 8 1440 true 12 12 12 false do-nothing block-if-contains-last-replica false false 1 1 false false disabled 30 600 false true 5 false fast-check 0 0 /7 * false 25 false 200 30 1 false if-not-present false 0 4 3 79816021 2 8589934592 0 3 3 1 1683598257082240493 v1.5.0-dev 5.3.18-59.37-default "sles" k3s v1.23.15+k3s1 1 1 1683598257825718008 v1.5.0-dev 5.3.18-59.37-default "sles" k3s v1.23.15+k3s1 1 1 ``` Set up the upgrade responder server. Verify the database when the `Allow Collecting Longhorn Usage Metrics` setting is enabled or disabled. `None` `None`