Skip to content

Commit

Permalink
Add error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
constanca-m committed Oct 27, 2023
1 parent 5ee94b1 commit 2970b8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libbeat/processors/add_cloud_metadata/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func setupFetchers(providers map[string]provider, c *conf.C) ([]metadataFetcher,
mf := make([]metadataFetcher, 0, len(providers))
visited := map[string]bool{}

// Iterate over all providers and create an unique meta-data fetcher per provider type.
// Iterate over all providers and create a unique meta-data fetcher per provider type.
// Some providers might appear twice in the set of providers to support aliases on provider names.
// For example aws and ec2 both use the same provider.
// The loop tracks already seen providers in the `visited` set, to ensure that we do not create
Expand All @@ -123,7 +123,7 @@ func setupFetchers(providers map[string]provider, c *conf.C) ([]metadataFetcher,
}

// fetchMetadata attempts to fetch metadata in parallel from each of the
// hosting providers supported by this processor. It wait for the results to
// hosting providers supported by this processor. It will wait for the results to
// be returned or for a timeout to occur then returns the first result that
// completed in time.
func (p *addCloudMetadata) fetchMetadata() *result {
Expand Down Expand Up @@ -169,6 +169,8 @@ func (p *addCloudMetadata) fetchMetadata() *result {
// Bail out on first success.
if result.err == nil && result.metadata != nil {
return &result
} else if result.err != nil {
p.logger.Errorf("add_cloud_metadata: received error %v", result.err)
}
case <-ctx.Done():
p.logger.Debugf("add_cloud_metadata: timed-out waiting for all responses")
Expand Down

0 comments on commit 2970b8a

Please sign in to comment.