Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metricbeat] Fix silent failures in kafka and prometheus #13353

Merged
merged 4 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Print errors that were being omitted in vSphere metricsets. {pull}12816[12816]
- Fix redis key metricset dashboard references to index pattern. {pull}13303[13303]
- Check if fields in DBInstance is nil in rds metricset. {pull}13294[13294] {issue}13037[13037]
- Fix silent failures in kafka and prometheus module. {pull}13353[13353] {issue}13252[13252]

*Packetbeat*

Expand Down
2 changes: 2 additions & 0 deletions metricbeat/helper/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"io"
"net/http"

"github.com/pkg/errors"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"

Expand Down Expand Up @@ -83,6 +84,7 @@ func (p *prometheus) GetFamilies() ([]*dto.MetricFamily, error) {
if err == io.EOF {
break
}
return nil, errors.Wrap(err, "Decode MetricFamily failed")
kaiyan-sheng marked this conversation as resolved.
Show resolved Hide resolved
} else {
families = append(families, mf)
}
Expand Down
4 changes: 1 addition & 3 deletions metricbeat/module/kafka/partition/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ type MetricSet struct {
topics []string
}

var errFailQueryOffset = errors.New("operation failed")

var debugf = logp.MakeDebug("kafka")

// New creates a new instance of the partition MetricSet.
Expand Down Expand Up @@ -123,7 +121,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error {

if !offOK {
if err == nil {
err = errFailQueryOffset
err = errors.Wrap(err, "operation failed")
kaiyan-sheng marked this conversation as resolved.
Show resolved Hide resolved
}

msg := fmt.Errorf("Failed to query kafka partition (%v:%v) offsets: %v",
Expand Down