Skip to content

Commit

Permalink
Update metricbeat/module/kubernetes/util/kubernetes.go
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Katsoulis <[email protected]>
  • Loading branch information
constanca-m and MichaelKatsoulis authored Feb 8, 2024
1 parent 7aedbe8 commit a902efe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion metricbeat/module/kubernetes/util/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,11 @@ func buildMetadataEnricher(
if watcher != nil {
watcher.enrichers[metricsetName] = enricher

// Check if there are past events for this resource and update metadata if there are
// Check if this shared watcher has already detected resources from a previous enricher.
// In that case, for each resource, call the updateFunc of the current enricher to
// update its metadata. This is needed in cases where the watcher has already been
// notified for new/updated resources while the enricher for current metricset has not
// built yet(example is pod, state_pod metricsets).
for key, _ := range watcher.metadataObjects {
obj, exists, err := watcher.watcher.Store().GetByKey(key)
if err != nil {
Expand Down

0 comments on commit a902efe

Please sign in to comment.