Skip to content

Commit

Permalink
Fix supported field error handling.
Browse files Browse the repository at this point in the history
Minor comment fixes.
  • Loading branch information
igorpeshansky committed Jul 17, 2024
1 parent 4cc8a8b commit d0ad1ad
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions receiver/dcgmreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ func newClient(config *Config, logger *zap.Logger) (*dcgmClient, error) {
requestedFieldIDs := discoverRequestedFieldIDs(config)
supportedRegularFieldIDs, err := getSupportedRegularFields(requestedFieldIDs, logger)
if err != nil {
// TODO: If there is error querying the supported fields at all, let the
// receiver collect no metrics.
logger.Sugar().Warnf("Error querying supported regular fields on '%w'. Regular GPU metrics will not be collected.", err)
return nil, fmt.Errorf("Error querying supported regular fields: %w", err)
}
supportedProfilingFieldIDs, err := getSupportedProfilingFields()
if err != nil {
Expand Down Expand Up @@ -313,7 +311,7 @@ func getSupportedRegularFields(requestedFields []dcgm.Short, logger *zap.Logger)
if ef < dcgmProfilingFieldsStart {
// For fields like `DCGM_FI_DEV_*`, which are not
// profiling fields, try to actually retrieve the values
// all devices
// from all devices
regularFields = append(regularFields, ef)
}
}
Expand Down

0 comments on commit d0ad1ad

Please sign in to comment.