Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: StorageGrid collector should be included in autosupport #1729

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions cmd/collectors/storagegrid/storagegrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,29 +535,31 @@ func (s *StorageGrid) CollectAutoSupport(p *collector.Payload) {
p.Target.Model = "storagegrid"
p.Target.ClusterUUID = s.client.Cluster.UUID

md := s.GetMetadata()
info := collector.InstanceInfo{
Count: md.LazyValueInt64("instances", "data"),
DataPoints: md.LazyValueInt64("metrics", "data"),
PollTime: md.LazyValueInt64("poll_time", "data"),
APITime: md.LazyValueInt64("api_time", "data"),
ParseTime: md.LazyValueInt64("parse_time", "data"),
PluginTime: md.LazyValueInt64("plugin_time", "data"),
}

if s.Object == "Tenant" {
if p.Nodes == nil {
nodeIds, err := s.getNodeUuids()
if err != nil {
// log the error, but don't exit method so the other info below is collected
s.Logger.Error().
Err(err).
Msg("Unable to get nodes.")
// log the error, but don't exit method so subsequent info is collected
s.Logger.Error().Err(err).Msg("Unable to get nodes.")
nodeIds = make([]collector.ID, 0)
}
info.Ids = nodeIds
p.Nodes = &collector.InstanceInfo{
Ids: nodeIds,
Count: int64(len(nodeIds)),
}
}

p.Nodes = &info
if s.Object == "Tenant" {
md := s.GetMetadata()
info := collector.InstanceInfo{
Count: md.LazyValueInt64("instances", "data"),
DataPoints: md.LazyValueInt64("metrics", "data"),
PollTime: md.LazyValueInt64("poll_time", "data"),
APITime: md.LazyValueInt64("api_time", "data"),
ParseTime: md.LazyValueInt64("parse_time", "data"),
PluginTime: md.LazyValueInt64("plugin_time", "data"),
}
p.Tenants = &info
}
}

func (s *StorageGrid) getNodeUuids() ([]collector.ID, error) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/poller/collector/asup.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ type Payload struct {
Target *TargetInfo
Harvest *harvestInfo
Platform *platformInfo
Nodes *InstanceInfo
Volumes *InstanceInfo
Nodes *InstanceInfo `json:"Nodes,omitempty"`
Volumes *InstanceInfo `json:"Volumes,omitempty"`
Tenants *InstanceInfo `json:"Tenants,omitempty"`
Collectors *[]AsupCollector
path string
}
Expand Down