Change:
}) } } <ins> func TestGetHistogramVecFromGatherer(t *testing.T) { var registerMetrics sync.Once tests := []struct { name    string lvMap   map[string]string wantVec HistogramVec }{ { name:  "filter with one label", lvMap: map[string]string{"label1": "value1-0"}, wantVec: HistogramVec{ &Histogram{&dto.Histogram{ SampleCount: uint64Ptr(1), SampleSum:   pointer.Float64Ptr(1.5), Bucket: []*dto.Bucket{ {CumulativeCount: uint64Ptr(0), UpperBound: pointer.Float64Ptr(0.5)}, {CumulativeCount: uint64Ptr(1), UpperBound: pointer.Float64Ptr(2.0)}, {CumulativeCount: uint64Ptr(1), UpperBound: pointer.Float64Ptr(5.0)}, }, }}, &Histogram{&dto.Histogram{ SampleCount: uint64Ptr(1), SampleSum:   pointer.Float64Ptr(2.5), Bucket: []*dto.Bucket{ {CumulativeCount: uint64Ptr(0), UpperBound: pointer.Float64Ptr(0.5)}, {CumulativeCount: uint64Ptr(0), UpperBound: pointer.Float64Ptr(2.0)}, {CumulativeCount: uint64Ptr(1), UpperBound: pointer.Float64Ptr(5.0)}, }, }}, }, }, { name:  "filter with two labels", lvMap: map[string]string{"label1": "value1-0", "label2": "value2-1"}, wantVec: HistogramVec{ &Histogram{&dto.Histogram{ SampleCount: uint64Ptr(1), SampleSum:   pointer.Float64Ptr(2.5), Bucket: []*dto.Bucket{ {CumulativeCount: uint64Ptr(0), UpperBound: pointer.Float64Ptr(0.5)}, {CumulativeCount: uint64Ptr(0), UpperBound: pointer.Float64Ptr(2.0)}, {CumulativeCount: uint64Ptr(1), UpperBound: pointer.Float64Ptr(5.0)}, }, }}, }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { buckets := []float64{.5, 2, 5} // HistogramVec has two labels defined. labels := []string{"label1", "label2"} HistogramOpts := &metrics.HistogramOpts{ Namespace: "namespace", Name:      "metric_test_name", Subsystem: "subsystem", Help:      "histogram help message", Buckets:   buckets, } vec := metrics.NewHistogramVec(HistogramOpts, labels) registerMetrics.Do(func() { legacyregistry.MustRegister(vec) }) // Observe two metrics with same value for label1 but different value of label2. vec.WithLabelValues("value1-0", "value2-0").Observe(1.5) vec.WithLabelValues("value1-0", "value2-1").Observe(2.5) vec.WithLabelValues("value1-1", "value2-0").Observe(3.5) vec.WithLabelValues("value1-1", "value2-1").Observe(4.5) metricName := fmt.Sprintf("%s_%s_%s", HistogramOpts.Namespace, HistogramOpts.Subsystem, HistogramOpts.Name) histogramVec, _ := GetHistogramVecFromGatherer(legacyregistry.DefaultGatherer, metricName, tt.lvMap) if diff := cmp.Diff(tt.wantVec, histogramVec); diff != "" { t.Errorf("Got unexpected HistogramVec (-want +got):n%s", diff) } }) } } </ins>

Discussion:
<!-- Please only use this template for submitting enhancement requests --What would you like to be : run got the below error message, We should provide the metric data for different extension points from the metric of "schedulerframeworkextensionpointdurationseconds" Why is this needed: Those metrics have been removed by this commit - Those metrics are deprecated cause it is suggested to use - , but simply remove those metrics definitely is not a nice way to address the issue. /sig scheduling
/triage accept
The label(s) cannot be applied, because the repository doesn't have them <detailsIn response to : /triage accept Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/triage accepted
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-contributor-experience at . /lifecycle stale
/lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-contributor-experience at . /lifecycle stale
/remove-lifecycle stale