Skip to content

Commit

Permalink
Remove metadata prefix from config as not needed (elastic#3095) (elas…
Browse files Browse the repository at this point in the history
…tic#3099)

(cherry picked from commit e2a4bbe)
  • Loading branch information
ruflin authored and tsg committed Dec 1, 2016
1 parent 059656e commit 36d76a1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 21 deletions.
5 changes: 2 additions & 3 deletions metricbeat/_meta/beat.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ metricbeat.modules:
#hosts: ["localhost:9092"]

#client_id: metricbeat

#metadata.retries: 3
#metadata.backoff: 250ms
#retries: 3
#backoff: 250ms

# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []
Expand Down
5 changes: 2 additions & 3 deletions metricbeat/docs/modules/kafka.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ metricbeat.modules:
#hosts: ["localhost:9092"]
#client_id: metricbeat
#metadata.retries: 3
#metadata.backoff: 250ms
#retries: 3
#backoff: 250ms
# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []
Expand Down
5 changes: 2 additions & 3 deletions metricbeat/metricbeat.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ metricbeat.modules:
#hosts: ["localhost:9092"]

#client_id: metricbeat

#metadata.retries: 3
#metadata.backoff: 250ms
#retries: 3
#backoff: 250ms

# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []
Expand Down
5 changes: 2 additions & 3 deletions metricbeat/module/kafka/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
#hosts: ["localhost:9092"]

#client_id: metricbeat

#metadata.retries: 3
#metadata.backoff: 250ms
#retries: 3
#backoff: 250ms

# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []
Expand Down
11 changes: 4 additions & 7 deletions metricbeat/module/kafka/partition/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
)

type connConfig struct {
Metadata metaConfig `config:"metadata"`
Retries int `config:"retries" validate:"min=0"`
Backoff time.Duration `config:"backoff" validate:"min=0"`
TLS *outputs.TLSConfig `config:"ssl"`
Username string `config:"username"`
Password string `config:"password"`
Expand All @@ -17,15 +18,11 @@ type connConfig struct {
}

type metaConfig struct {
Retries int `config:"retries" validate:"min=0"`
Backoff time.Duration `config:"backoff" validate:"min=0"`
}

var defaultConfig = connConfig{
Metadata: metaConfig{
Retries: 3,
Backoff: 250 * time.Millisecond,
},
Retries: 3,
Backoff: 250 * time.Millisecond,
TLS: nil,
Username: "",
Password: "",
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/module/kafka/partition/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
cfg.Net.DialTimeout = base.Module().Config().Timeout
cfg.Net.ReadTimeout = base.Module().Config().Timeout
cfg.ClientID = config.ClientID
cfg.Metadata.Retry.Max = config.Metadata.Retries
cfg.Metadata.Retry.Backoff = config.Metadata.Backoff
cfg.Metadata.Retry.Max = config.Retries
cfg.Metadata.Retry.Backoff = config.Backoff
if tls != nil {
cfg.Net.TLS.Enable = true
cfg.Net.TLS.Config = tls.BuildModuleConfig("")
Expand Down

0 comments on commit 36d76a1

Please sign in to comment.