Skip to content

Commit

Permalink
Cherry-pick #9642 to 6.x: Export field for xpack.enabled setting (#9655)
Browse files Browse the repository at this point in the history
Cherry-pick of PR #9642 to 6.x branch. Original message: 

The cleanup in #8308 introduced a regression which caused the `xpack.enabled` flag in the `kibana` module to stop having any effect.

This PR fixes that issue by reverting the troublesome bits from #8308, ensuring that the struct field for the parsed configuration setting is exported.
  • Loading branch information
ycombinator authored Dec 19, 2018
1 parent aceafd3 commit 1a28b31
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions metricbeat/module/kibana/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,18 @@ type MetricSet struct {
// NewMetricSet creates a metricset that can be used to build other metricsets
// within the Kibana module.
func NewMetricSet(base mb.BaseMetricSet) (*MetricSet, error) {
config := struct {
xPackEnabled bool `config:"xpack.enabled"`
}{
xPackEnabled: false,
}

config := DefaultConfig()
if err := base.Module().UnpackConfig(&config); err != nil {
return nil, err
}

if config.xPackEnabled {
if config.XPackEnabled {
cfgwarn.Experimental("The experimental xpack.enabled flag in the " + base.FullyQualifiedName() + " metricset is enabled.")
}

return &MetricSet{
base,
config.xPackEnabled,
config.XPackEnabled,
logp.NewLogger(ModuleName),
}, nil
}

0 comments on commit 1a28b31

Please sign in to comment.