zalando-zmon / zmon-worker

ZMON Python Worker
https://zmon.io/
Other
19 stars 41 forks source link

[feature request] Implement msearch for elasticsearch client #346

Open Nilegfx opened 6 years ago

Nilegfx commented 6 years ago

Currently I've to do multiple http requests to fetch some metrics with different criteria from our elasticsearch cluster, it would be nice if elasticsearch's zmon client implements msearch Multi search API

We've elasticsearch client and I am running a handful of queries each minute to check the state of the indexes, problematic documents, correct documents, write rates .. etc, currently I am doing each one of them as single check with a dedicated request elasticsearch(url).count(), but elasticsearch has an interesting API called msearch that enables us to do multiple searches once and returning the result as an array of responses. this saves a quite good amount of requests that only executes for ZMON.

I think a good approach to tackle this challenge is to implement msearch in zmon's elasticsearch worker which IS a write safe API