@@ -84,6 +84,13 @@ func TestMatrixMatchLabel(t *testing.T) {
8484 port : 10080 ,
8585 expectedPairs : []model.SamplePair {{Timestamp : 1712700000000 , Value : 100 }},
8686 },
87+ {
88+ jsonRes : `[{"metric":{"__name__":"process_cpu_seconds_total","instance":"tc-tidb-0","job":"tidb"},"values":[[1712700000,"100"]]}, {"metric":{"__name__":"process_cpu_seconds_total","instance":"tc-tidb-1","job":"tidb"},"values":[[1712700000,"200"]]}]` ,
89+ addr : "tc-tidb-0.tc-tidb-peer.ns.svc.cluster.local:4000" ,
90+ ip : "tc-tidb-0.tc-tidb-peer.ns.svc.cluster.local" ,
91+ port : 10080 ,
92+ expectedPairs : []model.SamplePair {{Timestamp : 1712700000000 , Value : 100 }},
93+ },
8794 {
8895 jsonRes : `[]` ,
8996 addr : "tc-tidb-0.tc-tidb-peer.ns.svc:4000" ,
@@ -148,6 +155,13 @@ func TestVectorMatchLabel(t *testing.T) {
148155 port : 10080 ,
149156 expectedSample : & model.Sample {Timestamp : 1712700000000 , Value : 100 },
150157 },
158+ {
159+ jsonRes : `[{"metric":{"__name__":"process_cpu_seconds_total","instance":"tc-tidb-0","job":"tidb"},"value":[1712700000,"100"]}, {"metric":{"__name__":"process_cpu_seconds_total","instance":"tc-tidb-1","job":"tidb"},"value":[1712700000,"200"]}]` ,
160+ addr : "tc-tidb-0.tc-tidb-peer.ns.svc.cluster.local:4000" ,
161+ ip : "tc-tidb-0.tc-tidb-peer.ns.svc.cluster.local" ,
162+ port : 10080 ,
163+ expectedSample : & model.Sample {Timestamp : 1712700000000 , Value : 100 },
164+ },
151165 {
152166 jsonRes : `[]` ,
153167 addr : "tc-tidb-0.tc-tidb-peer.ns.svc:4000" ,
@@ -188,6 +202,10 @@ func TestAddrMatchLabel(t *testing.T) {
188202 addr : "tc-tidb-0.tc-tidb-peer.ns.svc:3080" ,
189203 label : "tc-tidb-0" ,
190204 },
205+ {
206+ addr : "tc-tidb-0.tc-tidb-peer.ns.svc.cluster.local:3080" ,
207+ label : "tc-tidb-0" ,
208+ },
191209 }
192210
193211 for i , test := range tests {
0 commit comments