diff --git a/cmd/otel-allocator/prehook/prehook.go b/cmd/otel-allocator/prehook/prehook.go index 4956651ffd..4e30e951fa 100644 --- a/cmd/otel-allocator/prehook/prehook.go +++ b/cmd/otel-allocator/prehook/prehook.go @@ -34,10 +34,6 @@ var ( Name: "opentelemetry_allocator_targets_kept", Help: "Number of targets kept after filtering.", }, []string{"job_name"}) - TargetsDropped = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "opentelemetry_allocator_targets_dropped", - Help: "Number of targets dropped after filtering.", - }, []string{"job_name"}) ) type Hook interface { diff --git a/cmd/otel-allocator/prehook/relabel.go b/cmd/otel-allocator/prehook/relabel.go index bda9faaea1..54059773c6 100644 --- a/cmd/otel-allocator/prehook/relabel.go +++ b/cmd/otel-allocator/prehook/relabel.go @@ -49,16 +49,12 @@ func convertLabelToPromLabelSet(lbls model.LabelSet) []labels.Label { func (tf *RelabelConfigTargetFilter) Apply(targets map[string]*target.Item) map[string]*target.Item { numTargets := len(targets) - var droppedTargetsPerJob, targetsPerJob map[string]float64 // need to wait until relabelCfg is set if len(tf.relabelCfg) == 0 { return targets } - droppedTargetsPerJob = make(map[string]float64) - targetsPerJob = GetTargetsPerJob(targets) - // Note: jobNameKey != tItem.JobName (jobNameKey is hashed) for jobNameKey, tItem := range targets { keepTarget := true @@ -74,16 +70,7 @@ func (tf *RelabelConfigTargetFilter) Apply(targets map[string]*target.Item) map[ if !keepTarget { delete(targets, jobNameKey) - droppedTargetsPerJob[tItem.JobName] += 1 } - - } - - // add metrics for number of targets kept and dropped per job. - for jName, numTargets := range targetsPerJob { - numDropped := droppedTargetsPerJob[jName] - TargetsDropped.WithLabelValues(jName).Set(numDropped) - TargetsKept.WithLabelValues(jName).Set(numTargets-numDropped) } tf.log.V(2).Info("Filtering complete", "seen", numTargets, "kept", len(targets)) diff --git a/pkg/collector/reconcile/configmap_test.go b/pkg/collector/reconcile/configmap_test.go index e6c2300f27..bdc13d79ca 100644 --- a/pkg/collector/reconcile/configmap_test.go +++ b/pkg/collector/reconcile/configmap_test.go @@ -194,7 +194,6 @@ config: - targets: - 0.0.0.0:8888 - 0.0.0.0:9999 -filter_strategy: no-op label_selector: app.kubernetes.io/component: opentelemetry-collector app.kubernetes.io/instance: default.test @@ -327,7 +326,6 @@ func TestExpectedConfigMap(t *testing.T) { } taConfig["config"] = parmConfig taConfig["allocation_strategy"] = "least-weighted" - taConfig["filter_strategy"] = "no-op" taConfigYAML, _ := yaml.Marshal(taConfig) assert.Equal(t, string(taConfigYAML), actual.Data["targetallocator.yaml"])