From a50fe95370ebc65e138e61b8da8ea35f834cf8e7 Mon Sep 17 00:00:00 2001 From: Sam Storie Date: Sun, 9 Jan 2022 20:29:13 -0600 Subject: [PATCH] chore: adding/updating the documentation for mscluster_resourcegroup collector Signed-off-by: Sam Storie --- collector/mscluster_resourcegroup.go | 60 +++++------------------ docs/collector.mscluster_resourcegroup.md | 41 ++++++++++++++++ 2 files changed, 54 insertions(+), 47 deletions(-) create mode 100644 docs/collector.mscluster_resourcegroup.md diff --git a/collector/mscluster_resourcegroup.go b/collector/mscluster_resourcegroup.go index 51e2c616..fe805b5c 100644 --- a/collector/mscluster_resourcegroup.go +++ b/collector/mscluster_resourcegroup.go @@ -34,97 +34,79 @@ func newMSCluster_ResourceGroupCollector() (Collector, error) { return &MSCluster_ResourceGroupCollector{ AutoFailbackType: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "auto_failback_type"), - "(AutoFailbackType)", + "Provides access to the group's AutoFailbackType property.", []string{"name"}, nil, ), Characteristics: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "characteristics"), - "(Characteristics)", + "Provides the characteristics of the group.", []string{"name"}, nil, ), ColdStartSetting: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "cold_start_setting"), - "(ColdStartSetting)", + "Indicates whether a group can start after a cluster cold start.", []string{"name"}, nil, ), DefaultOwner: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "default_owner"), - "(DefaultOwner)", + "Number of the last node the resource group was activated on or explicitly moved to.", []string{"name"}, nil, ), FailbackWindowEnd: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "failback_window_end"), - "(FailbackWindowEnd)", + "The FailbackWindowEnd property provides the latest time that the group can be moved back to the node identified as its preferred node.", []string{"name"}, nil, ), FailbackWindowStart: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "failback_window_start"), - "(FailbackWindowStart)", + "The FailbackWindowStart property provides the earliest time (that is, local time as kept by the cluster) that the group can be moved back to the node identified as its preferred node.", []string{"name"}, nil, ), FailoverPeriod: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "failover_period"), - "(FailoverPeriod)", + "The FailoverPeriod property specifies a number of hours during which a maximum number of failover attempts, specified by the FailoverThreshold property, can occur.", []string{"name"}, nil, ), FailoverThreshold: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "failover_threshold"), - "(FailoverThreshold)", - []string{"name"}, - nil, - ), - FaultDomain: prometheus.NewDesc( - prometheus.BuildFQName(Namespace, subsystem, "fault_domain"), - "(FaultDomain)", + "The FailoverThreshold property specifies the maximum number of failover attempts.", []string{"name"}, nil, ), Flags: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "flags"), - "(Flags)", + "Provides access to the flags set for the group. ", []string{"name"}, nil, ), GroupType: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "group_type"), - "(GroupType)", - []string{"name"}, - nil, - ), - PlacementOptions: prometheus.NewDesc( - prometheus.BuildFQName(Namespace, subsystem, "placement_options"), - "(PlacementOptions)", + "The Type of the resource group.", []string{"name"}, nil, ), Priority: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "priority"), - "(Priority)", + "Priority value of the resource group", []string{"name"}, nil, ), ResiliencyPeriod: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "resiliency_period"), - "(ResiliencyPeriod)", + "The resiliency period for this group, in seconds.", []string{"name"}, nil, ), State: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "state"), - "(State)", - []string{"name"}, - nil, - ), - UpdateDomain: prometheus.NewDesc( - prometheus.BuildFQName(Namespace, subsystem, "update_domain"), - "(UpdateDomain)", + "The current state of the resource group. -1: Unknown; 0: Online; 1: Offline; 2: Failed; 3: Partial Online; 4: Pending", []string{"name"}, nil, ), @@ -145,10 +127,8 @@ type MSCluster_ResourceGroup struct { FailbackWindowStart int FailoverPeriod uint FailoverThreshold uint - FaultDomain uint Flags uint GroupType uint - PlacementOptions uint Priority uint ResiliencyPeriod uint State uint @@ -222,13 +202,6 @@ func (c *MSCluster_ResourceGroupCollector) Collect(ctx *ScrapeContext, ch chan<- v.Name, ) - ch <- prometheus.MustNewConstMetric( - c.FaultDomain, - prometheus.GaugeValue, - float64(v.FaultDomain), - v.Name, - ) - ch <- prometheus.MustNewConstMetric( c.Flags, prometheus.GaugeValue, @@ -243,13 +216,6 @@ func (c *MSCluster_ResourceGroupCollector) Collect(ctx *ScrapeContext, ch chan<- v.Name, ) - ch <- prometheus.MustNewConstMetric( - c.PlacementOptions, - prometheus.GaugeValue, - float64(v.PlacementOptions), - v.Name, - ) - ch <- prometheus.MustNewConstMetric( c.Priority, prometheus.GaugeValue, diff --git a/docs/collector.mscluster_resourcegroup.md b/docs/collector.mscluster_resourcegroup.md new file mode 100644 index 00000000..98d2e18a --- /dev/null +++ b/docs/collector.mscluster_resourcegroup.md @@ -0,0 +1,41 @@ +# mscluster_resourcegroup collector + +The MSCluster_ResourceGroup class is a dynamic WMI class that represents a cluster group. + +||| +-|- +Metric name prefix | `mscluster_resourcegroup` +Classes | `MSCluster_ResourceGroup` +Enabled by default? | No + +## Flags + +None + +## Metrics + +Name | Description | Type | Labels +-----|-------------|------|------- +`AutoFailbackType` | Provides access to the group's AutoFailbackType property. | guage | `name` +`Characteristics` | Provides the characteristics of the group. The cluster defines characteristics only for resources. For a description of these characteristics, see [CLUSCTL_RESOURCE_GET_CHARACTERISTICS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-characteristics). | guage | `name` +`ColdStartSetting` | Indicates whether a group can start after a cluster cold start. | guage | `name` +`DefaultOwner` | Number of the last node the resource group was activated on or explicitly moved to. | guage | `name` +`FailbackWindowEnd` | The FailbackWindowEnd property provides the latest time that the group can be moved back to the node identified as its preferred node. | guage | `name` +`FailbackWindowStart` | The FailbackWindowStart property provides the earliest time (that is, local time as kept by the cluster) that the group can be moved back to the node identified as its preferred node. | guage | `name` +`FailoverPeriod` | The FailoverPeriod property specifies a number of hours during which a maximum number of failover attempts, specified by the FailoverThreshold property, can occur. | guage | `name` +`FailoverThreshold` | The FailoverThreshold property specifies the maximum number of failover attempts. | guage | `name` +`Flags` | Provides access to the flags set for the group. The cluster defines flags only for resources. For a description of these flags, see [CLUSCTL_RESOURCE_GET_FLAGS](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-get-flags). | guage | `name` +`GroupType` | The Type of the resource group. | guage | `name` +`Priority` | Priority value of the resource group | guage | `name` +`ResiliencyPeriod` | The resiliency period for this group, in seconds. | guage | `name` +`State` | The current state of the resource group. -1: Unknown; 0: Online; 1: Offline; 2: Failed; 3: Partial Online; 4: Pending | guage | `name` +`UpdateDomain` | | guage | `name` + +### Example metric +_This collector does not yet have explained examples, we would appreciate your help adding them!_ + +## Useful queries +_This collector does not yet have any useful queries added, we would appreciate your help adding them!_ + +## Alerting examples +_This collector does not yet have alerting examples, we would appreciate your help adding them!_