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

count 429s in elasticsearch output #8056

Merged
merged 2 commits into from
Aug 27, 2018
Merged

count 429s in elasticsearch output #8056

merged 2 commits into from
Aug 27, 2018

Conversation

graphaelli
Copy link
Member

As a libbeat user, I'd like more help tracking down when elasticsearch is the bottleneck in event ingestion and could use configuration tuning or more nodes. A rise in 429s can provide some indication of this situation.

This change adds a new observable method ErrTooMany and corresponding monitoring metric output.events.toomany that is only reported by the elasticsearch output.

Eventually, a distribution of time spent in queue (ack time - receive time) would be useful across more outputs, but this is a start.

@graphaelli
Copy link
Member Author

Open to suggestions on how to test this.

@ph
Copy link
Contributor

ph commented Aug 22, 2018

@graphaelli I am +1 to track 429 at the output level, Concerning testing sadly I don't think we test any of the stats at the client level. I would probably take the following strategy:

  1. Implement a mock http to control the response.
  2. Create a spy observer and do the assert there?

@ruflin
Copy link
Member

ruflin commented Aug 23, 2018

I think it would be super helpful to have these values also in stack monitoring. If you agree, could you open a meta issue here? https://github.com/elastic/stack-monitoring

@graphaelli
Copy link
Member Author

@ph I started adding that and found some existing code that actually works for this. 97cb68c up for review.

Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @ruflin you want to take a look since you were commenting?

stats.nonIndexable++
continue
if status < 500 {
if status == http.StatusTooManyRequests {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad I am not the only one that use these constants :)

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please make sure to file a follow up issue in stack-monitoring so we have it in Elasticsearch templates and the UI.

@ph ph merged commit 109dcce into elastic:master Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants