Skip to content

Commit

Permalink
Set server metricset in graphite as default (#6757)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and jsoriano committed Apr 5, 2018
1 parent bf4b84c commit 36436c2
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 36 deletions.
10 changes: 1 addition & 9 deletions metricbeat/docs/modules/graphite.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ beta[]

This is the graphite Module.

The default metricset is `server`.


[float]
Expand All @@ -21,15 +22,6 @@ in <<configuration-metricbeat>>. 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]
Expand Down
24 changes: 18 additions & 6 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,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 ------------------------------
Expand Down
22 changes: 22 additions & 0 deletions metricbeat/module/graphite/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -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: "_"

9 changes: 0 additions & 9 deletions metricbeat/module/graphite/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -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: "_"

1 change: 1 addition & 0 deletions metricbeat/module/graphite/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
This is the graphite Module.

The default metricset is `server`.
6 changes: 3 additions & 3 deletions metricbeat/module/graphite/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions metricbeat/modules.d/graphite.yml.disabled
Original file line number Diff line number Diff line change
@@ -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: "_"

0 comments on commit 36436c2

Please sign in to comment.