ElasticSearch Stats相关的API
Node status
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cluster-nodes-stats.html
Cluster status
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cluster-stats.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cluster-state.html
Index status
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/indices-stats.html
ElasticSearch Task相关API
Pending Cluster Tasks
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cluster-pending.html
Task Management API
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/tasks.html
监控Thread Pools
GET _cat/thread_pool?v
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cat-thread-pool.html
GET _nodes/hot_threads
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cluster-nodes-hot-threads.html
GET _nodes/stats/thread_pool
thread_pool |
Statistics about each thread pool, including current size, queue and rejected tasks |
---|---|
The Index&Query Slow Log
PUT myindex/
{
"settings": {
"index.search.slowlog.threshold": {
"query.warn": "10s",
"query.info": "3s",
"query.debug": "2s",
"query.trace": "0s",
"fetch.warn": "1s",
"fetch.info": "600ms",
"fetch.debug": "400ms",
"fetch.trace": "0s"
}
}
}
支持将分片上,search和fetch阶段的慢查询写入文件
支持为query和fetch分别定义阈值
索引级的动态设置,可以按需设置,或者通过index template统一设定
slow log文件通过log4j2.properties配置
如何创建监控Dashboard
- 开发Elasticsearch plugin,通过读取相关的监控API,将数据发送到ES,或者TSDB
- 开发Metricbeats搜集相关指标
- 使用Kibana或Graffna创建Dashboard
- 开发Elasticsearch Exporter,通过Prometheus监控Elasticsearch集群