|
|
@ -75,6 +75,18 @@ test_metric2{foo="boo",instance="i"} 1 6000000 |
|
|
|
code: 200, |
|
|
|
code: 200, |
|
|
|
body: `# TYPE test_metric_without_labels untyped |
|
|
|
body: `# TYPE test_metric_without_labels untyped |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
|
|
|
|
`, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"test_stale_metric": { |
|
|
|
|
|
|
|
params: "match[]=test_metric_stale", |
|
|
|
|
|
|
|
code: 200, |
|
|
|
|
|
|
|
body: ``, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"test_old_metric": { |
|
|
|
|
|
|
|
params: "match[]=test_metric_old", |
|
|
|
|
|
|
|
code: 200, |
|
|
|
|
|
|
|
body: `# TYPE test_metric_old untyped |
|
|
|
|
|
|
|
test_metric_old{instance=""} 981 5880000 |
|
|
|
`, |
|
|
|
`, |
|
|
|
}, |
|
|
|
}, |
|
|
|
"{foo='boo'}": { |
|
|
|
"{foo='boo'}": { |
|
|
@ -104,6 +116,8 @@ test_metric1{foo="bar",instance="i"} 10000 6000000 |
|
|
|
test_metric1{foo="boo",instance="i"} 1 6000000 |
|
|
|
test_metric1{foo="boo",instance="i"} 1 6000000 |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
test_metric2{foo="boo",instance="i"} 1 6000000 |
|
|
|
test_metric2{foo="boo",instance="i"} 1 6000000 |
|
|
|
|
|
|
|
# TYPE test_metric_old untyped |
|
|
|
|
|
|
|
test_metric_old{instance=""} 981 5880000 |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
`, |
|
|
|
`, |
|
|
@ -111,7 +125,9 @@ test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
"empty label value matches everything that doesn't have that label": { |
|
|
|
"empty label value matches everything that doesn't have that label": { |
|
|
|
params: "match[]={foo='',__name__=~'.%2b'}", |
|
|
|
params: "match[]={foo='',__name__=~'.%2b'}", |
|
|
|
code: 200, |
|
|
|
code: 200, |
|
|
|
body: `# TYPE test_metric_without_labels untyped |
|
|
|
body: `# TYPE test_metric_old untyped |
|
|
|
|
|
|
|
test_metric_old{instance=""} 981 5880000 |
|
|
|
|
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
`, |
|
|
|
`, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -123,6 +139,8 @@ test_metric1{foo="bar",instance="i"} 10000 6000000 |
|
|
|
test_metric1{foo="boo",instance="i"} 1 6000000 |
|
|
|
test_metric1{foo="boo",instance="i"} 1 6000000 |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
test_metric2{foo="boo",instance="i"} 1 6000000 |
|
|
|
test_metric2{foo="boo",instance="i"} 1 6000000 |
|
|
|
|
|
|
|
# TYPE test_metric_old untyped |
|
|
|
|
|
|
|
test_metric_old{instance=""} 981 5880000 |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
test_metric_without_labels{instance=""} 1001 6000000 |
|
|
|
`, |
|
|
|
`, |
|
|
@ -136,6 +154,8 @@ test_metric1{foo="bar",instance="i",zone="ie"} 10000 6000000 |
|
|
|
test_metric1{foo="boo",instance="i",zone="ie"} 1 6000000 |
|
|
|
test_metric1{foo="boo",instance="i",zone="ie"} 1 6000000 |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
test_metric2{foo="boo",instance="i",zone="ie"} 1 6000000 |
|
|
|
test_metric2{foo="boo",instance="i",zone="ie"} 1 6000000 |
|
|
|
|
|
|
|
# TYPE test_metric_old untyped |
|
|
|
|
|
|
|
test_metric_old{foo="baz",instance="",zone="ie"} 981 5880000 |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
test_metric_without_labels{foo="baz",instance="",zone="ie"} 1001 6000000 |
|
|
|
test_metric_without_labels{foo="baz",instance="",zone="ie"} 1001 6000000 |
|
|
|
`, |
|
|
|
`, |
|
|
@ -151,6 +171,8 @@ test_metric1{foo="bar",instance="i"} 10000 6000000 |
|
|
|
test_metric1{foo="boo",instance="i"} 1 6000000 |
|
|
|
test_metric1{foo="boo",instance="i"} 1 6000000 |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
# TYPE test_metric2 untyped |
|
|
|
test_metric2{foo="boo",instance="i"} 1 6000000 |
|
|
|
test_metric2{foo="boo",instance="i"} 1 6000000 |
|
|
|
|
|
|
|
# TYPE test_metric_old untyped |
|
|
|
|
|
|
|
test_metric_old{instance="baz"} 981 5880000 |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
# TYPE test_metric_without_labels untyped |
|
|
|
test_metric_without_labels{instance="baz"} 1001 6000000 |
|
|
|
test_metric_without_labels{instance="baz"} 1001 6000000 |
|
|
|
`, |
|
|
|
`, |
|
|
@ -164,6 +186,8 @@ func TestFederation(t *testing.T) { |
|
|
|
test_metric1{foo="boo",instance="i"} 1+0x100 |
|
|
|
test_metric1{foo="boo",instance="i"} 1+0x100 |
|
|
|
test_metric2{foo="boo",instance="i"} 1+0x100 |
|
|
|
test_metric2{foo="boo",instance="i"} 1+0x100 |
|
|
|
test_metric_without_labels 1+10x100 |
|
|
|
test_metric_without_labels 1+10x100 |
|
|
|
|
|
|
|
test_metric_stale 1+10x99 stale |
|
|
|
|
|
|
|
test_metric_old 1+10x98 |
|
|
|
`) |
|
|
|
`) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
t.Fatal(err) |
|
|
|
t.Fatal(err) |
|
|
|