Skip to content

Commit

Permalink
Set collector as defalt in dropwizard module
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Apr 3, 2018
1 parent fbc61e8 commit fd242de
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
4 changes: 1 addition & 3 deletions metricbeat/docs/modules/dropwizard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This file is generated! See scripts/docs_collector.py

beta[]

This is the http://dropwizard.io[Dropwizard] module.
This is the http://dropwizard.io[Dropwizard] module. The default metricset is `collector`.



Expand All @@ -21,8 +21,6 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: dropwizard
metricsets: ["collector"]
period: 10s
hosts: ["localhost:8080"]
metrics_path: /metrics/metrics
namespace: example
Expand Down
1 change: 1 addition & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ metricbeat.modules:
hosts: ["localhost:8080"]
metrics_path: /metrics/metrics
namespace: example
enabled: true

#---------------------------- Elasticsearch Module ---------------------------
- module: elasticsearch
Expand Down
7 changes: 7 additions & 0 deletions metricbeat/module/dropwizard/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- module: dropwizard
metricsets: ["collector"]
period: 10s
hosts: ["localhost:8080"]
metrics_path: /metrics/metrics
namespace: example
enabled: true
2 changes: 0 additions & 2 deletions metricbeat/module/dropwizard/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- module: dropwizard
metricsets: ["collector"]
period: 10s
hosts: ["localhost:8080"]
metrics_path: /metrics/metrics
namespace: example
2 changes: 1 addition & 1 deletion metricbeat/module/dropwizard/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the http://dropwizard.io[Dropwizard] module.
This is the http://dropwizard.io[Dropwizard] module. The default metricset is `collector`.

7 changes: 4 additions & 3 deletions metricbeat/module/dropwizard/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ var (
// 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("dropwizard", "collector", New, hostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("dropwizard", "collector", New,
mb.WithHostParser(hostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet type defines all fields of the MetricSet
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/modules.d/dropwizard.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- module: dropwizard
metricsets: ["collector"]
period: 10s
hosts: ["localhost:8080"]
metrics_path: /metrics/metrics
namespace: example

0 comments on commit fd242de

Please sign in to comment.