Query ES cluster state size

I would like to get the size of the compressed cluster state (as done in PublishClusterStateAction) using an external API. Is it something possible? I am not calling it from java so I cannot duplicate the code doing the serialisation of the cluster state.

I don't think so, it's quite expensive to compute this number so it almost never happens. Why would you want to know this statistic? It's a pretty obscure internal detail.

Thanks! I would like to publish this as a metric to monitor my clusters :). Something like every hour or so.

I'm still none the wiser about how this is a useful number to look at, but FWIW this will give you a good approximation:

curl -s https://$ES:9200/_cluster/state -H'Accept: application/smile' | gzip -3 | wc -c
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.