stackdriver: pattern formatting for annotations
This commit is contained in:
@@ -19,14 +19,14 @@ func TestStackdriverAnnotationQuery(t *testing.T) {
|
||||
|
||||
res := &tsdb.QueryResult{Meta: simplejson.New(), RefId: "annotationQuery"}
|
||||
query := &StackdriverQuery{}
|
||||
err = executor.parseToAnnotations(res, data, query, "atitle", "atext", "atag")
|
||||
err = executor.parseToAnnotations(res, data, query, "atitle {{metric.label.instance_name}} {{value}}", "atext {{resource.label.zone}}", "atag")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Convey("Should return annotations table", func() {
|
||||
So(len(res.Tables), ShouldEqual, 1)
|
||||
So(len(res.Tables[0].Rows), ShouldEqual, 9)
|
||||
So(res.Tables[0].Rows[0][1], ShouldEqual, "atitle")
|
||||
So(res.Tables[0].Rows[0][3], ShouldEqual, "atext")
|
||||
So(res.Tables[0].Rows[0][1], ShouldEqual, "atitle collector-asia-east-1 9.856650")
|
||||
So(res.Tables[0].Rows[0][3], ShouldEqual, "atext asia-east1-a")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user