chore: adding/updating the documentation for mscluster_resourcegroup collector

Signed-off-by: Sam Storie <sam.storie@emerson.com>
This commit is contained in:
Sam Storie 2022-01-09 20:29:13 -06:00 committed by Ben Reedy
parent 33615c8b58
commit a50fe95370
No known key found for this signature in database
GPG Key ID: 235C15B6086C9D7E
2 changed files with 54 additions and 47 deletions

View File

@ -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,

View File

@ -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!_