@@ -697,14 +697,12 @@ func TestMostRecentTimestampInMetric(t *testing.T) {
697
697
func TestPrometheusConverter_AddSummaryDataPoints (t * testing.T ) {
698
698
ts := pcommon .Timestamp (time .Now ().UnixNano ())
699
699
tests := []struct {
700
- name string
701
- isGateEnabled bool
702
- metric func () pmetric.Metric
703
- want func () map [uint64 ]* prompb.TimeSeries
700
+ name string
701
+ metric func () pmetric.Metric
702
+ want func () map [uint64 ]* prompb.TimeSeries
704
703
}{
705
704
{
706
- name : "summary with start time" ,
707
- isGateEnabled : false ,
705
+ name : "summary with start time" ,
708
706
metric : func () pmetric.Metric {
709
707
metric := pmetric .NewMetric ()
710
708
metric .SetName ("test_summary" )
@@ -720,9 +718,6 @@ func TestPrometheusConverter_AddSummaryDataPoints(t *testing.T) {
720
718
labels := []prompb.Label {
721
719
{Name : model .MetricNameLabel , Value : "test_summary" + countStr },
722
720
}
723
- createdLabels := []prompb.Label {
724
- {Name : model .MetricNameLabel , Value : "test_summary" + createdSuffix },
725
- }
726
721
sumLabels := []prompb.Label {
727
722
{Name : model .MetricNameLabel , Value : "test_summary" + sumStr },
728
723
}
@@ -739,18 +734,11 @@ func TestPrometheusConverter_AddSummaryDataPoints(t *testing.T) {
739
734
{Value : 0 , Timestamp : convertTimeStamp (ts )},
740
735
},
741
736
},
742
- timeSeriesSignature (createdLabels ): {
743
- Labels : createdLabels ,
744
- Samples : []prompb.Sample {
745
- {Value : float64 (convertTimeStamp (ts )), Timestamp : convertTimeStamp (ts )},
746
- },
747
- },
748
737
}
749
738
},
750
739
},
751
740
{
752
- name : "summary without start time" ,
753
- isGateEnabled : false ,
741
+ name : "summary without start time" ,
754
742
metric : func () pmetric.Metric {
755
743
metric := pmetric .NewMetric ()
756
744
metric .SetName ("test_summary" )
@@ -785,8 +773,7 @@ func TestPrometheusConverter_AddSummaryDataPoints(t *testing.T) {
785
773
},
786
774
},
787
775
{
788
- name : "summary with exportCreatedMetricGate enabled" ,
789
- isGateEnabled : true ,
776
+ name : "summary with exportCreatedMetricGate enabled" ,
790
777
metric : func () pmetric.Metric {
791
778
metric := pmetric .NewMetric ()
792
779
metric .SetName ("test_summary" )
@@ -825,7 +812,7 @@ func TestPrometheusConverter_AddSummaryDataPoints(t *testing.T) {
825
812
for _ , tt := range tests {
826
813
t .Run (tt .name , func (t * testing.T ) {
827
814
oldValue := exportCreatedMetricGate .IsEnabled ()
828
- testutil .SetFeatureGateForTest (t , exportCreatedMetricGate , tt . isGateEnabled )
815
+ testutil .SetFeatureGateForTest (t , exportCreatedMetricGate , true )
829
816
defer testutil .SetFeatureGateForTest (t , exportCreatedMetricGate , oldValue )
830
817
831
818
metric := tt .metric ()
@@ -849,14 +836,12 @@ func TestPrometheusConverter_AddSummaryDataPoints(t *testing.T) {
849
836
func TestPrometheusConverter_AddHistogramDataPoints (t * testing.T ) {
850
837
ts := pcommon .Timestamp (time .Now ().UnixNano ())
851
838
tests := []struct {
852
- name string
853
- isGateEnabled bool
854
- metric func () pmetric.Metric
855
- want func () map [uint64 ]* prompb.TimeSeries
839
+ name string
840
+ metric func () pmetric.Metric
841
+ want func () map [uint64 ]* prompb.TimeSeries
856
842
}{
857
843
{
858
- name : "histogram with start time" ,
859
- isGateEnabled : false ,
844
+ name : "histogram with start time" ,
860
845
metric : func () pmetric.Metric {
861
846
metric := pmetric .NewMetric ()
862
847
metric .SetName ("test_hist" )
@@ -872,9 +857,6 @@ func TestPrometheusConverter_AddHistogramDataPoints(t *testing.T) {
872
857
labels := []prompb.Label {
873
858
{Name : model .MetricNameLabel , Value : "test_hist" + countStr },
874
859
}
875
- createdLabels := []prompb.Label {
876
- {Name : model .MetricNameLabel , Value : "test_hist" + createdSuffix },
877
- }
878
860
infLabels := []prompb.Label {
879
861
{Name : model .MetricNameLabel , Value : "test_hist_bucket" },
880
862
{Name : model .BucketLabel , Value : "+Inf" },
@@ -892,18 +874,11 @@ func TestPrometheusConverter_AddHistogramDataPoints(t *testing.T) {
892
874
{Value : 0 , Timestamp : convertTimeStamp (ts )},
893
875
},
894
876
},
895
- timeSeriesSignature (createdLabels ): {
896
- Labels : createdLabels ,
897
- Samples : []prompb.Sample {
898
- {Value : float64 (convertTimeStamp (ts )), Timestamp : convertTimeStamp (ts )},
899
- },
900
- },
901
877
}
902
878
},
903
879
},
904
880
{
905
- name : "histogram without start time" ,
906
- isGateEnabled : false ,
881
+ name : "histogram without start time" ,
907
882
metric : func () pmetric.Metric {
908
883
metric := pmetric .NewMetric ()
909
884
metric .SetName ("test_hist" )
@@ -939,8 +914,7 @@ func TestPrometheusConverter_AddHistogramDataPoints(t *testing.T) {
939
914
},
940
915
},
941
916
{
942
- name : "histogram with exportCreatedMetricGate enabled" ,
943
- isGateEnabled : true ,
917
+ name : "histogram with exportCreatedMetricGate enabled" ,
944
918
metric : func () pmetric.Metric {
945
919
metric := pmetric .NewMetric ()
946
920
metric .SetName ("test_hist" )
@@ -980,7 +954,7 @@ func TestPrometheusConverter_AddHistogramDataPoints(t *testing.T) {
980
954
for _ , tt := range tests {
981
955
t .Run (tt .name , func (t * testing.T ) {
982
956
oldValue := exportCreatedMetricGate .IsEnabled ()
983
- testutil .SetFeatureGateForTest (t , exportCreatedMetricGate , tt . isGateEnabled )
957
+ testutil .SetFeatureGateForTest (t , exportCreatedMetricGate , true )
984
958
defer testutil .SetFeatureGateForTest (t , exportCreatedMetricGate , oldValue )
985
959
986
960
metric := tt .metric ()
0 commit comments