Skip to content
Merged
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
9 changes: 8 additions & 1 deletion pkg/controller/utils/datadog/metrics_forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"errors"
"fmt"
"hash/fnv"
"maps"
"os"
"strings"
"sync"
Expand Down Expand Up @@ -438,7 +439,7 @@ func (mf *metricsForwarder) forwardMetrics() error {
}

// send feature metrics
for _, featuresList := range mf.EnabledFeatures {
for _, featuresList := range mf.snapshotEnabledFeatures() {
for _, feature := range featuresList {
mf.sendFeatureMetric(ctx, feature)
}
Expand All @@ -449,6 +450,12 @@ func (mf *metricsForwarder) forwardMetrics() error {
return nil
}

func (mf *metricsForwarder) snapshotEnabledFeatures() map[string][]string {
mf.RLock()
defer mf.RUnlock()
return maps.Clone(mf.EnabledFeatures)
}

// processReconcileError updates lastReconcileErr
// and sends reconcile metrics based on the reconcile errors
func (mf *metricsForwarder) processReconcileError(reconcileErr error) error {
Expand Down
Loading