Commit 8499d32d by Torkel Ödegaard

Merge branch 'master' of github.com:grafana/grafana

parents d894c137 a530df84
...@@ -358,7 +358,7 @@ interval_seconds = 60 ...@@ -358,7 +358,7 @@ interval_seconds = 60
# Send internal Grafana metrics to graphite # Send internal Grafana metrics to graphite
; [metrics.graphite] ; [metrics.graphite]
; address = localhost:2003 ; address = localhost:2003
; prefix = service.grafana.%(instance_name)s ; prefix = service.grafana.%(instance_name)s.
[grafana_net] [grafana_net]
url = https://grafana.net url = https://grafana.net
...@@ -306,7 +306,7 @@ enabled = true ...@@ -306,7 +306,7 @@ enabled = true
# Send internal metrics to Graphite # Send internal metrics to Graphite
; [metrics.graphite] ; [metrics.graphite]
; address = localhost:2003 ; address = localhost:2003
; prefix = service.grafana.%(instance_name)s ; prefix = service.grafana.%(instance_name)s.
#################################### Internal Grafana Metrics ########################## #################################### Internal Grafana Metrics ##########################
# Url used to to import dashboards directly from Grafana.net # Url used to to import dashboards directly from Grafana.net
......
...@@ -32,7 +32,7 @@ will be expected to export different things. You can find what's expected for [d ...@@ -32,7 +32,7 @@ will be expected to export different things. You can find what's expected for [d
and [apps](./apps.md) plugins in the documentation. and [apps](./apps.md) plugins in the documentation.
## Start developing your plugin ## Start developing your plugin
There are two ways that you can start developing a Grafana plugin. There are three ways that you can start developing a Grafana plugin.
1. Setup a Grafana development environment. [(described here)](http://docs.grafana.org/project/building_from_source/) and place your plugin in the ```data/plugins``` folder. 1. Setup a Grafana development environment. [(described here)](http://docs.grafana.org/project/building_from_source/) and place your plugin in the ```data/plugins``` folder.
2. Install Grafana and place your plugin in the plugins directory which is set in your [config file](../installation/configuration.md). By default this is `/var/lib/grafana/plugins` on Linux systems. 2. Install Grafana and place your plugin in the plugins directory which is set in your [config file](../installation/configuration.md). By default this is `/var/lib/grafana/plugins` on Linux systems.
......
...@@ -21,7 +21,7 @@ type GraphitePublisher struct { ...@@ -21,7 +21,7 @@ type GraphitePublisher struct {
func CreateGraphitePublisher() (*GraphitePublisher, error) { func CreateGraphitePublisher() (*GraphitePublisher, error) {
graphiteSection, err := setting.Cfg.GetSection("metrics.graphite") graphiteSection, err := setting.Cfg.GetSection("metrics.graphite")
if err != nil { if err != nil {
return nil, err return nil, nil
} }
publisher := &GraphitePublisher{} publisher := &GraphitePublisher{}
...@@ -33,7 +33,7 @@ func CreateGraphitePublisher() (*GraphitePublisher, error) { ...@@ -33,7 +33,7 @@ func CreateGraphitePublisher() (*GraphitePublisher, error) {
prefix := graphiteSection.Key("prefix").Value() prefix := graphiteSection.Key("prefix").Value()
if prefix == "" { if prefix == "" {
prefix = "service.grafana.%(instance_name)s" prefix = "service.grafana.%(instance_name)s."
} }
publisher.prefix = strings.Replace(prefix, "%(instance_name)s", safeInstanceName, -1) publisher.prefix = strings.Replace(prefix, "%(instance_name)s", safeInstanceName, -1)
......
...@@ -19,8 +19,8 @@ func TestGraphitePublisher(t *testing.T) { ...@@ -19,8 +19,8 @@ func TestGraphitePublisher(t *testing.T) {
So(err, ShouldBeNil) So(err, ShouldBeNil)
sec, err := setting.Cfg.NewSection("metrics.graphite") sec, err := setting.Cfg.NewSection("metrics.graphite")
sec.NewKey("prefix", "service.grafana.%(instance_name)s") sec.NewKey("prefix", "service.grafana.%(instance_name)s.")
sec.NewKey("address", "localhost:2003") sec.NewKey("address", "localhost:2001")
So(err, ShouldBeNil) So(err, ShouldBeNil)
...@@ -30,7 +30,8 @@ func TestGraphitePublisher(t *testing.T) { ...@@ -30,7 +30,8 @@ func TestGraphitePublisher(t *testing.T) {
So(err, ShouldBeNil) So(err, ShouldBeNil)
So(publisher, ShouldNotBeNil) So(publisher, ShouldNotBeNil)
So(publisher.prefix, ShouldEqual, "service.grafana.hostname_with_dots_com") So(publisher.prefix, ShouldEqual, "service.grafana.hostname_with_dots_com.")
So(publisher.address, ShouldEqual, "localhost:2001")
}) })
Convey("Test graphite publisher default values", t, func() { Convey("Test graphite publisher default values", t, func() {
...@@ -49,7 +50,7 @@ func TestGraphitePublisher(t *testing.T) { ...@@ -49,7 +50,7 @@ func TestGraphitePublisher(t *testing.T) {
So(err, ShouldBeNil) So(err, ShouldBeNil)
So(publisher, ShouldNotBeNil) So(publisher, ShouldNotBeNil)
So(publisher.prefix, ShouldEqual, "service.grafana.hostname_with_dots_com") So(publisher.prefix, ShouldEqual, "service.grafana.hostname_with_dots_com.")
So(publisher.address, ShouldEqual, "localhost:2003") So(publisher.address, ShouldEqual, "localhost:2003")
}) })
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment