diff --git a/metricbeat/docs/modules/graphite.asciidoc b/metricbeat/docs/modules/graphite.asciidoc index bec73f5c926..94531c11fd1 100644 --- a/metricbeat/docs/modules/graphite.asciidoc +++ b/metricbeat/docs/modules/graphite.asciidoc @@ -9,6 +9,7 @@ beta[] This is the graphite Module. +The default metricset is `server`. [float] @@ -21,15 +22,6 @@ in <>. Here is an example configuration: ---- metricbeat.modules: - module: graphite - metricsets: ["server"] - enabled: true -# protocol: "udp" -# templates: -# - filter: "test.*.bash.*" # This would match metrics like test.localhost.bash.stats -# namespace: "test" -# template: ".host.shell.metric*" # test.localhost.bash.stats would become metric=stats and tags host=localhost,shell=bash -# delimiter: "_" - ---- [float] diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 548d0bad0fd..2518ba79bf2 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -203,12 +203,24 @@ metricbeat.modules: - module: graphite metricsets: ["server"] enabled: true -# protocol: "udp" -# templates: -# - filter: "test.*.bash.*" # This would match metrics like test.localhost.bash.stats -# namespace: "test" -# template: ".host.shell.metric*" # test.localhost.bash.stats would become metric=stats and tags host=localhost,shell=bash -# delimiter: "_" + + # Host address to listen on. Default localhost. + #host: localhost + + # Listening port. Default 2003. + #port: 2003 + + # Protocol to listen on. This can be udp or tcp. Default udp. + #protocol: "udp" + + # Receive buffer size in bytes + #receive_buffer_size: 1024 + + #templates: + # - filter: "test.*.bash.*" # This would match metrics like test.localhost.bash.stats + # namespace: "test" + # template: ".host.shell.metric*" # test.localhost.bash.stats would become metric=stats and tags host=localhost,shell=bash + # delimiter: "_" #------------------------------- HAProxy Module ------------------------------ diff --git a/metricbeat/module/graphite/_meta/config.reference.yml b/metricbeat/module/graphite/_meta/config.reference.yml new file mode 100644 index 00000000000..29bb1a47f49 --- /dev/null +++ b/metricbeat/module/graphite/_meta/config.reference.yml @@ -0,0 +1,22 @@ +- module: graphite + metricsets: ["server"] + enabled: true + + # Host address to listen on. Default localhost. + #host: localhost + + # Listening port. Default 2003. + #port: 2003 + + # Protocol to listen on. This can be udp or tcp. Default udp. + #protocol: "udp" + + # Receive buffer size in bytes + #receive_buffer_size: 1024 + + #templates: + # - filter: "test.*.bash.*" # This would match metrics like test.localhost.bash.stats + # namespace: "test" + # template: ".host.shell.metric*" # test.localhost.bash.stats would become metric=stats and tags host=localhost,shell=bash + # delimiter: "_" + diff --git a/metricbeat/module/graphite/_meta/config.yml b/metricbeat/module/graphite/_meta/config.yml index b5318ecd7ad..2c6ac0e784b 100644 --- a/metricbeat/module/graphite/_meta/config.yml +++ b/metricbeat/module/graphite/_meta/config.yml @@ -1,10 +1 @@ - module: graphite - metricsets: ["server"] - enabled: true -# protocol: "udp" -# templates: -# - filter: "test.*.bash.*" # This would match metrics like test.localhost.bash.stats -# namespace: "test" -# template: ".host.shell.metric*" # test.localhost.bash.stats would become metric=stats and tags host=localhost,shell=bash -# delimiter: "_" - diff --git a/metricbeat/module/graphite/_meta/docs.asciidoc b/metricbeat/module/graphite/_meta/docs.asciidoc index 38e61c08734..0ddac8ffa1e 100644 --- a/metricbeat/module/graphite/_meta/docs.asciidoc +++ b/metricbeat/module/graphite/_meta/docs.asciidoc @@ -1,2 +1,3 @@ This is the graphite Module. +The default metricset is `server`. diff --git a/metricbeat/module/graphite/server/server.go b/metricbeat/module/graphite/server/server.go index 6a3973aa7a7..caa2f9bcdef 100644 --- a/metricbeat/module/graphite/server/server.go +++ b/metricbeat/module/graphite/server/server.go @@ -14,9 +14,9 @@ import ( // init registers the MetricSet with the central registry. // The New method will be called after the setup of the module and before starting to fetch data func init() { - if err := mb.Registry.AddMetricSet("graphite", "server", New); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("graphite", "server", New, + mb.DefaultMetricSet(), + ) } // MetricSet type defines all fields of the MetricSet diff --git a/metricbeat/modules.d/graphite.yml.disabled b/metricbeat/modules.d/graphite.yml.disabled index b5318ecd7ad..2c6ac0e784b 100644 --- a/metricbeat/modules.d/graphite.yml.disabled +++ b/metricbeat/modules.d/graphite.yml.disabled @@ -1,10 +1 @@ - module: graphite - metricsets: ["server"] - enabled: true -# protocol: "udp" -# templates: -# - filter: "test.*.bash.*" # This would match metrics like test.localhost.bash.stats -# namespace: "test" -# template: ".host.shell.metric*" # test.localhost.bash.stats would become metric=stats and tags host=localhost,shell=bash -# delimiter: "_" -