@@ -665,6 +665,14 @@ func TestConvertSummaryMetrics(t *testing.T) {
665665 Nanos : 100000997 ,
666666 }
667667
668+ res := & resourcepb.Resource {
669+ Type : resourcekeys .ContainerType ,
670+ Labels : map [string ]string {
671+ resourcekeys .ContainerKeyName : "container1" ,
672+ resourcekeys .K8SKeyClusterName : "cluster1" ,
673+ },
674+ }
675+
668676 tests := []struct {
669677 in * metricspb.Metric
670678 want []* metricspb.Metric
@@ -702,6 +710,7 @@ func TestConvertSummaryMetrics(t *testing.T) {
702710 },
703711 },
704712 },
713+ Resource : res ,
705714 },
706715 statsExporter : & statsExporter {
707716 o : Options {ProjectID : "foo" },
@@ -717,6 +726,7 @@ func TestConvertSummaryMetrics(t *testing.T) {
717726 Timeseries : []* metricspb.TimeSeries {
718727 makeDoubleTs (119.0 , "" , startTimestamp , endTimestamp ),
719728 },
729+ Resource : res ,
720730 },
721731 {
722732 MetricDescriptor : & metricspb.MetricDescriptor {
@@ -728,6 +738,7 @@ func TestConvertSummaryMetrics(t *testing.T) {
728738 Timeseries : []* metricspb.TimeSeries {
729739 makeInt64Ts (10 , "" , startTimestamp , endTimestamp ),
730740 },
741+ Resource : res ,
731742 },
732743 {
733744 MetricDescriptor : & metricspb.MetricDescriptor {
@@ -745,6 +756,7 @@ func TestConvertSummaryMetrics(t *testing.T) {
745756 makeDoubleTs (12.6 , "90.000000" , nil , endTimestamp ),
746757 makeDoubleTs (19.6 , "99.000000" , nil , endTimestamp ),
747758 },
759+ Resource : res ,
748760 },
749761 },
750762 },
0 commit comments