-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Make elasticsearch/index_summary
metricset more defensive
#12489
Conversation
Pinging @elastic/stack-monitoring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, did not test locally.
Do you want to add a changelog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally and it behaves as described. 👍
Added CHANGELOG entry. Will merge when CI goes green again. |
jenkins, test this |
…astic#12489) (elastic#12507) * Refactoring: extract common schema * Don't try to parse stats API response further if there is no data in the cluster * Adding CHANGELOG entry
Resolves #12487.
When there is absolutely no data in an Elasticsearch cluster, the
elasticsearch/index_summary
metricset, withxpack.enabled: true
set, emits the following error in the Metricbeat log:Having absolutely no data in the cluster is a "cold start" edge case that must be handled gracefully. This PR makes it so.
Concretely, this PR:
GET _stats
API response being used by theelasticsearch/index_summary
metricset contains any stats for primary shards. If it doesn't, it doesn't try to parse the API response any further.Testing this PR
Make sure Elasticsearch API is accessible on
http://localhost:9200
.Enable the
elasticsearch-xpack
Metricbeat module.Make sure there is no data in Elasticsearch. If there is, make sure nothing is indexing to it, and then run:
Run Metricbeat.
Assert that no errors are thrown in the Metricbeat log.
Assert that a
.monitoring-es-*mb*
index gets created in Elasticsearch.