Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion metricbeat/helper/elastic/elastic.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ func MakeXPackMonitoringIndexName(product Product) string {
// ReportErrorForMissingField reports and returns an error message for the given
// field being missing in API response received from a given product
func ReportErrorForMissingField(field string, product Product, r mb.ReporterV2) error {
err := fmt.Errorf("Could not find field '%v' in %v stats API response", field, strings.Title(product.String()))
err := MakeErrorForMissingField(field, product)
r.Error(err)
return err
}

// MakeErrorForMissingField returns an error message for the given field being missing in an API
// response received from a given product
func MakeErrorForMissingField(field string, product Product) error {
return fmt.Errorf("Could not find field '%v' in %v stats API response", field, strings.Title(product.String()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) {

// Not master, no event sent
if !isMaster {
logp.Debug("elasticsearch", "Trying to fetch index recovery stats from a non master node.")
logp.Debug("elasticsearch", "Trying to fetch cluster stats from a non master node.")
return
}

Expand All @@ -73,5 +73,9 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) {
return
}

eventMapping(r, content)
if m.MetricSet.XPack {
eventMappingXPack(r, m, content)
} else {
eventMapping(r, content)
}
}
Loading