@@ -1080,81 +1080,6 @@ func TestExporter_makeReq_withCustomMonitoredResource(t *testing.T) {
10801080 },
10811081 },
10821082 },
1083- {
1084- name : "GetMonitoredResource and labels" ,
1085- opts : func () Options {
1086- var labels Labels
1087- labels .Set ("pid" , "1234" , "Process identifier" )
1088- return Options {
1089- GetMonitoredResource : func (v * view.View , t []tag.Tag ) ([]tag.Tag , monitoredresource.Interface ) {
1090- return t , gceInst
1091- },
1092- DefaultMonitoringLabels : & labels ,
1093- }
1094- }(),
1095- vd : newTestViewData (v , start , end , count1 , count2 ),
1096- want : []* monitoringpb.CreateTimeSeriesRequest {
1097- {
1098- Name : monitoring .MetricProjectPath ("proj-id" ),
1099- TimeSeries : []* monitoringpb.TimeSeries {
1100- {
1101- Metric : & metricpb.Metric {
1102- Type : "custom.googleapis.com/opencensus/testview" ,
1103- Labels : map [string ]string {
1104- "test_key" : "test-value-1" ,
1105- "pid" : "1234" ,
1106- },
1107- },
1108- Resource : resource ,
1109- Points : []* monitoringpb.Point {
1110- {
1111- Interval : & monitoringpb.TimeInterval {
1112- StartTime : & timestamp.Timestamp {
1113- Seconds : start .Unix (),
1114- Nanos : int32 (start .Nanosecond ()),
1115- },
1116- EndTime : & timestamp.Timestamp {
1117- Seconds : end .Unix (),
1118- Nanos : int32 (end .Nanosecond ()),
1119- },
1120- },
1121- Value : & monitoringpb.TypedValue {Value : & monitoringpb.TypedValue_Int64Value {
1122- Int64Value : 10 ,
1123- }},
1124- },
1125- },
1126- },
1127- {
1128- Metric : & metricpb.Metric {
1129- Type : "custom.googleapis.com/opencensus/testview" ,
1130- Labels : map [string ]string {
1131- "test_key" : "test-value-2" ,
1132- "pid" : "1234" ,
1133- },
1134- },
1135- Resource : resource ,
1136- Points : []* monitoringpb.Point {
1137- {
1138- Interval : & monitoringpb.TimeInterval {
1139- StartTime : & timestamp.Timestamp {
1140- Seconds : start .Unix (),
1141- Nanos : int32 (start .Nanosecond ()),
1142- },
1143- EndTime : & timestamp.Timestamp {
1144- Seconds : end .Unix (),
1145- Nanos : int32 (end .Nanosecond ()),
1146- },
1147- },
1148- Value : & monitoringpb.TypedValue {Value : & monitoringpb.TypedValue_Int64Value {
1149- Int64Value : 16 ,
1150- }},
1151- },
1152- },
1153- },
1154- },
1155- },
1156- },
1157- },
11581083 {
11591084 name : "custom default monitoring labels" ,
11601085 opts : func () Options {
0 commit comments