使用Prometheus監控docker compose方式部署的ES

2023-01-06 12:00:29

需求

收集 ES 的指標, 並進行展示和告警;

現狀

  1. ES 通過 docker compose 安裝
  2. 所在環境的 K8S 叢集有 Prometheus 和 AlertManager 及 Grafana

方案

複用現有的監控體系, 通過: Prometheus 監控 ES.

具體實現為:

採集端 elasticsearch_exporter

可以監控的指標為:

Name Type Cardinality Help
elasticsearch_breakers_estimated_size_bytes gauge 4 Estimated size in bytes of breaker
elasticsearch_breakers_limit_size_bytes gauge 4 Limit size in bytes for breaker
elasticsearch_breakers_tripped counter 4 tripped for breaker
elasticsearch_cluster_health_active_primary_shards gauge 1 The number of primary shards in your cluster. This is an aggregate total across all indices.
elasticsearch_cluster_health_active_shards gauge 1 Aggregate total of all shards across all indices, which includes replica shards.
elasticsearch_cluster_health_delayed_unassigned_shards gauge 1 Shards delayed to reduce reallocation overhead
elasticsearch_cluster_health_initializing_shards gauge 1 Count of shards that are being freshly created.
elasticsearch_cluster_health_number_of_data_nodes gauge 1 Number of data nodes in the cluster.
elasticsearch_cluster_health_number_of_in_flight_fetch gauge 1 The number of ongoing shard info requests.
elasticsearch_cluster_health_number_of_nodes gauge 1 Number of nodes in the cluster.

...

可以直接在 github 上找到完整的

展示端 基於Grafana