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

Cherry-pick #15712 to 7.6: [Metricbeat]Log prometheus errors instead of parsing families #16231

Merged
merged 2 commits into from
Feb 12, 2020

Conversation

jsoriano
Copy link
Member

Cherry-pick of PR #15712 to 7.6 branch. Original message:

Solves #15709

Some users have been reporting errors fetching prometheus endpoints that include logs stating format errors decoding families.

Most probably metricbeat's prometheus helper has been trying to parse errors received as metric families. This PR adds the HTTP status code to the error sent upstream from the helper and also allows for writing the error body to log when debug is enabled.

…c#15712)

* log prometheus errors instead of parsing

(cherry picked from commit edc17b3)
@jsoriano
Copy link
Member Author

jenkins, test this again please

@jsoriano
Copy link
Member Author

jenkins, test this again please

This is failing in jenkins, could be related as state_deployment uses prometheus, but this doesn't fail locally or in travis 🤔

16:21:22 command [go test -race -cover -coverprofile /tmp/gotestcover-618583823 github.com/elastic/beats/metricbeat/mb/testing/data]: exit status 1
16:21:22 --- FAIL: TestAll (96.86s)
16:21:22     --- FAIL: TestAll/kubernetes.state_deployment (15.38s)
16:21:22         --- FAIL: TestAll/kubernetes.state_deployment/ksm-v1.8.0.plain (13.32s)
16:21:22             testdata.go:272: Event was not expected: {"error":{"message":"decoding of metric family failed: net/http: request canceled (Client.Timeout exceeded while reading body)"},"event":{"dataset":"kubernetes.state_deployment","duration":115000,"module":"kubernetes"},"metricset":{"name":"state_deployment","period":10000},"service":{"address":"127.0.0.1:55555","type":"kubernetes"}}

@jsoriano jsoriano merged commit ed5fd7f into elastic:7.6 Feb 12, 2020
@jsoriano jsoriano deleted the backport_15712_7.6 branch February 12, 2020 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants