Merge branch 'master' into alerting

This commit is contained in:
bergquist
2016-08-15 07:58:30 +02:00
12 changed files with 59 additions and 294 deletions

View File

@@ -33,7 +33,7 @@ func CreateGraphitePublisher() (*GraphitePublisher, error) {
prefix := graphiteSection.Key("prefix").Value()
if prefix == "" {
prefix = "service.grafana.%(instance_name)s"
prefix = "service.grafana.%(instance_name)s."
}
publisher.prefix = strings.Replace(prefix, "%(instance_name)s", safeInstanceName, -1)

View File

@@ -20,7 +20,7 @@ func TestGraphitePublisher(t *testing.T) {
sec, err := setting.Cfg.NewSection("metrics.graphite")
sec.NewKey("prefix", "service.grafana.%(instance_name)s.")
sec.NewKey("address", "localhost:2003")
sec.NewKey("address", "localhost:2001")
So(err, ShouldBeNil)
@@ -31,6 +31,7 @@ func TestGraphitePublisher(t *testing.T) {
So(publisher, ShouldNotBeNil)
So(publisher.prefix, ShouldEqual, "service.grafana.hostname_with_dots_com.")
So(publisher.address, ShouldEqual, "localhost:2001")
})
Convey("Test graphite publisher default values", t, func() {