From 7a2e31ed4dcde0f36325dabef8d454764ee03821 Mon Sep 17 00:00:00 2001 From: ruflin Date: Wed, 4 Apr 2018 10:55:10 +0200 Subject: [PATCH] Set server metricset in graphite as default --- metricbeat/docs/modules/graphite.asciidoc | 10 +------- metricbeat/metricbeat.reference.yml | 24 ++++++++++++++----- .../graphite/_meta/config.reference.yml | 22 +++++++++++++++++ metricbeat/module/graphite/_meta/config.yml | 9 ------- .../module/graphite/_meta/docs.asciidoc | 1 + metricbeat/module/graphite/server/server.go | 6 ++--- metricbeat/modules.d/graphite.yml.disabled | 9 ------- 7 files changed, 45 insertions(+), 36 deletions(-) create mode 100644 metricbeat/module/graphite/_meta/config.reference.yml diff --git a/metricbeat/docs/modules/graphite.asciidoc b/metricbeat/docs/modules/graphite.asciidoc index bec73f5c9267..94531c11fd19 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 548d0bad0fd2..2518ba79bf2a 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 000000000000..29bb1a47f494 --- /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 b5318ecd7ad4..2c6ac0e784bb 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 38e61c08734b..0ddac8ffa1e9 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 6a3973aa7a74..caa2f9bcdefe 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 b5318ecd7ad4..2c6ac0e784bb 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: "_" -