下载
wget https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.6.0/elasticsearch_exporter-1.6.0.linux-amd64.tar.gz
运行
nohup ./ elasticsearch_exporter --es.all --es.indices --es.cluster_settings --es.indices_se
ttings --es.shards --es.snapshots --es.timeout=10s --web.listen-address “:9114” --web.telemetry-path “/metrics” --es.uri http://
elastic:1qazXSW@@XXXXXX:9200 &
配置
**注意:**每次抓取时,导出器都会从Elasticsearch集群获取信息,因此,如果抓取间隔太短,会给es主节点带来负载,特别是在您使用–es.all和–es.indices。我们建议你测量一下/_nodes/stats和/_all/_stats需要您的es集群来确定您的抓取间隔是否太短。作为最后一种手段,您可以使用一个专用作业来清除该导出程序,该作业有自己的清除时间间隔。
下面是命令行选项摘要:
elasticsearch_exporter –help
参数 | 版本 | 描述 | 默认 |
---|---|---|---|
es.uri | 1.0.2 | 我们应该连接的Elasticsearch节点的地址(主机和端口)。这可以是本地节点(localhost:9200或者远程Elasticsearch服务器的地址。当需要基本身份验证时,指定为:😕/:@:。例如,http://admin:pass@localhost:9200。用户凭证中的特殊字符需要进行URL编码。 | http://本地主机:9200 |
es.all | 1.0.2 | 如果为true,则查询集群中所有节点的统计信息,而不仅仅是我们连接到的节点。 | False |
es.cluster_settings | 1.1.0rc1 | 如果为真,则查询集群设置的统计信息。 | False |
es.indices | 1.0.2 | 如果为真,则查询集群中所有索引的统计信息。 | False |
es.indices_settings | 1.0.4rc1 | 如果为真,则查询集群中所有索引的设置统计信息。 | False |
es.indices_mappings | 1.2.0 | 如果为真,则查询集群所有索引映射的统计信息。 | False |
es.aliases | 1.0.4rc1 | 如果为真,请包括信息别名指标。 | True |
es.shards | 1.0.3rc1 | 如果为真,查询集群中所有索引的统计信息,包括分片级别的统计信息(意味着es.indices=true). | False |
es.snapshots | 1.0.4rc1 | 如果为真,则查询集群快照的统计信息。 | False |
es.slm | 如果为真,则查询SLM的统计信息。 | False | |
es.data_stream | 如果为真,则查询数据流的状态。 | False | |
es.timeout | 1.0.2 | 尝试从Elasticsearch获取统计数据超时。(例如:20多岁) | 5s |
es.ca | 1.0.2 | 包含Elasticsearch连接的可信证书颁发机构的PEM文件的路径。 | |
es.client-private-key | 1.0.2 | 连接到Elasticsearch时包含客户端身份验证私钥的PEM文件的路径。 | |
es.client-cert | 1.0.2 | PEM文件的路径,该文件包含连接到Elasticsearch的私钥的相应证书。 | |
es.clusterinfo.interval | 1.1.0rc1 | 集群标签的集群信息更新间隔 | 5m |
es.ssl-skip-verify | 1.0.4rc1 | 连接到Elasticsearch时跳过SSL验证。 | False |
web.listen-address | 1.0.2 | web界面和遥测监听的地址。 | :9114 |
web.telemetry-path | 1.0.2 | 公开指标的路径。 | /指标 |
aws.region | 1.5.0 | AWS弹性搜索区域 | |
aws.role-arn | 1.6.0 | 要承担的IAM角色的角色ARN。 | |
version | 1.0.2 | 在stdout上显示版本信息并退出。 |
对于低于1.1.0rc1的版本,命令行参数以个单” -”开头。对于高于1.1.0rc1的版本,命令行参数用–指定。
可以使用ES_API_KEY环境变量设置用于连接的API密钥。
Elasticsearch 7.x安全权限
用户名和密码可以直接在URI中传递,也可以通过ES_USERNAME和ES_PASSWORD环境变量。指定这两个环境变量将覆盖在URI中传递的身份验证(如果有)。
ES 7.x支持RBACs。elasticsearch_exporter需要以下安全权限。
设置 | 必须的权限 | 描述 |
---|---|---|
exporter defaults | cluster monitor | 所有群集只读操作,如群集健康和状态、热线程、节点信息、节点和群集统计信息以及挂起的群集任务。 |
es.cluster_settings | cluster monitor | |
es.indices | indices monitor (per index or *) | 监控所需的所有操作(恢复、数据段信息、索引统计和状态) |
es.indices_settings | indices monitor (per index or *) | |
es.indices_mappings | indices view_index_metadata (per index or *) | |
es.shards | not sure if indices or cluster monitor or both | |
es.snapshots | cluster:admin/snapshot/status and cluster:admin/repository/get | ES论坛帖子 |
es.slm | read_slm | |
es.data_stream | monitor or manage (per index or *) |
指标
指标名称 | 类型 | 描述 | |
---|---|---|---|
elasticsearch_breakers_estimated_size_bytes | 测量 | 4 | 断路器的估计大小(以字节为单位) |
elasticsearch_breakers_limit_size_bytes | 测量 | 4 | 断路器的限制大小(以字节为单位) |
elasticsearch_breakers_tripped | 计数器 | 4 | 断路器跳闸 |
elasticsearch_cluster_health_active_primary_shards | 测量 | 1 | 集群中主碎片的数量。这是所有指数的合计总数。 |
elasticsearch_cluster_health_active_shards | 测量 | 1 | 所有索引中所有碎片的聚合总数,包括副本碎片。 |
elasticsearch_cluster_health_delayed_unassigned_shards | 测量 | 1 | 延迟碎片以减少重新分配开销 |
elasticsearch_cluster_health_initializing_shards | 测量 | 1 | 新创建的碎片数。 |
elasticsearch_cluster_health_number_of_data_nodes | 测量 | 1 | 群集中的数据节点数。 |
elasticsearch_cluster_health_number_of_in_flight_fetch | 测量 | 1 | 正在进行的碎片信息请求数。 |
elasticsearch_cluster_health_number_of_nodeselasticsearch_cluster_health_number_of_nodes | 测量 | 1 | 群集中健康打的节点数。 |
elasticsearch_cluster_health_number_of_pending_tasks | 测量 | 1 | 尚未执行的集群级别更改 |
elasticsearch_cluster_health_task_max_waiting_in_queue_millis | 测量 | 1 | 任务在队列中等待的最长时间(毫秒)。 |
elasticsearch_cluster_health_relocating_shards | 测量 | 1 | 当前从一个节点移动到另一个节点的碎片数。 |
elasticsearch_cluster_health_status | 测量 | 3 | 是否分配了所有主碎片和副本碎片。 |
elasticsearch_cluster_health_timed_out | 测量 | 1 | 超时的群集运行状况检查次数 |
elasticsearch_cluster_health_unassigned_shards | 测量 | 1 | 存在于群集状态中,但在群集本身中找不到的碎片数。 |
elasticsearch_clustersettings_stats_max_shards_per_node | 测量 | 0 | 每个节点设置的当前最大碎片数。 |
elasticsearch_clustersettings_allocation_threshold_enabled | 测量 | 0 | 是否启用了磁盘分配决策器。 |
elasticsearch_clustersettings_allocation_watermark_flood_stage_bytes | 测量 | 0 | 以字节为单位的洪水水位标志。 |
elasticsearch_clustersettings_allocation_watermark_high_bytes | 测量 | 0 | 以字节为单位的磁盘使用量高水位线。 |
elasticsearch_clustersettings_allocation_watermark_low_bytes | 测量 | 0 | 以字节为单位的磁盘使用量低水位线。 |
elasticsearch_clustersettings_allocation_watermark_flood_stage_ratio | 测量 | 0 | 作为比率的洪水水位线。 |
elasticsearch_clustersettings_allocation_watermark_high_ratio | 测量 | 0 | 磁盘使用比率的高水位线。 |
elasticsearch_clustersettings_allocation_watermark_low_ratio | 测量 | 0 | 以比率表示的磁盘使用率的低水位线。 |
elasticsearch_filesystem_data_available_bytes | 测量 | 1 | 块设备上的可用空间,以字节为单位 |
elasticsearch_filesystem_data_free_bytes | 测量 | 1 | 块设备上的可用空间(以字节为单位) |
elasticsearch_filesystem_data_size_bytes | 测量 | 1 | 块设备的大小(字节) |
elasticsearch_filesystem_io_stats_device_operations_count | 测量 | 1 | 磁盘操作计数 |
elasticsearch_filesystem_io_stats_device_read_operations_count | 测量 | 1 | 磁盘读取操作的计数 |
elasticsearch_filesystem_io_stats_device_write_operations_count | 测量 | 1 | 磁盘写操作计数 |
elasticsearch_filesystem_io_stats_device_read_size_kilobytes_sum | 测量 | 1 | 从磁盘读取的总千字节数 |
elasticsearch_filesystem_io_stats_device_write_size_kilobytes_sum | 测量 | 1 | 写入磁盘的总千字节数 |
elasticsearch_indices_active_queries | 测量 | 1 | 当前活动查询的数量 |
elasticsearch_indices_docs | 测量 | 1 | 此节点上的文档数 |
elasticsearch_indices_docs_deleted | 测量 | 1 | 此节点上已删除文档的计数 |
elasticsearch_indices_deleted_docs_primary | 测量 | 1 | 仅包含主碎片的已删除文档计数 |
elasticsearch_indices_docs_primary | 测量 | 1 | 所有节点上只有主碎片的文档数 |
elasticsearch_indices_docs_total | 测量 | 所有节点上带有碎片的文档数 | |
elasticsearch_indices_fielddata_evictions | 计数器 | 1 | 从现场数据中驱逐 |
elasticsearch_indices_fielddata_memory_size_bytes | 测量 | 1 | 字段数据缓存内存使用情况(以字节为单位) |
elasticsearch_indices_filter_cache_evictions | 计数器 | 1 | 从筛选器缓存中逐出 |
elasticsearch_indices_filter_cache_memory_size_bytes | 测量 | 1 | 以字节为单位的筛选器缓存内存使用情况 |
elasticsearch_indices_flush_time_seconds | 计数器 | 1 | 累积冲洗时间(秒) |
elasticsearch_indices_flush_total | 计数器 | 1 | 总冲洗次数 |
elasticsearch_indices_get_exists_time_seconds | 计数器 | 1 | 获取存在的总时间(秒) |
elasticsearch_indices_get_exists_total | 计数器 | 1 | get exists操作总数 |
elasticsearch_indices_get_missing_time_seconds | 计数器 | 1 | 丢失的总时间(秒) |
elasticsearch_indices_get_missing_total | 计数器 | 1 | 丢失总数 |
elasticsearch_indices_get_time_seconds | 计数器 | 1 | 总获取时间(秒) |
elasticsearch_indices_get_total | 计数器 | 1 | 总get |
elasticsearch_indices_indexing_delete_time_seconds_total | 计数器 | 1 | 索引删除的总时间(秒) |
elasticsearch_indices_indexing_delete_total | 计数器 | 1 | 索引删除总数 |
elasticsearch_indices_index_current | 测量 | 1 | 当前被编入索引的文档数 |
elasticsearch_indices_indexing_index_time_seconds_total | 计数器 | 1 | 累积索引时间(秒) |
elasticsearch_indices_indexing_index_total | 计数器 | 1 | 索引调用总数 |
elasticsearch_indices_mappings_stats_fields | 测量 | 1 | 当前由索引映射的字段计数 |
elasticsearch_indices_mappings_stats_json_parse_failures_total | 计数器 | 0 | 解析JSON时的错误数 |
elasticsearch_indices_mappings_stats_scrapes_total | 计数器 | 0 | 当前总弹性搜索指数映射 |
elasticsearch_indices_mappings_stats_up | 测量 | 0 | 弹性搜索指数映射端点的最后一次刮擦是否成功 |
elasticsearch_indices_merges_docs_total | 计数器 | 1 | 累计单据合并 |
elasticsearch_indices_merges_total | 计数器 | 1 | 合并总数 |
elasticsearch_indices_merges_total_time_seconds_total | 计数器 | 1 | 总合并大小(字节) |
elasticsearch_indices_merges_total_time_seconds_total | 计数器 | 1 | 花费在合并上的总时间(秒) |
elasticsearch_indices_query_cache_cache_total | 计数器 | 1 | 查询缓存计数 |
elasticsearch_indices_query_cache_cache_size | 测量 | 1 | 查询缓存的大小 |
elasticsearch_indices_query_cache_countmiss | 计数器 | 2 | 查询缓存命中/未命中计数 |
elasticsearch_indices_query_cache_evictions | 计数器 | 1 | 从查询缓存中逐出 |
elasticsearch_indices_query_cache_memory_size_bytes | 测量 | 1 | 查询缓存内存使用情况(以字节为单位) |
elasticsearch_indices_query_cache_total | 计数器 | 1 | 查询缓存总大小 |
elasticsearch_indices_refresh_time_seconds_total | 计数器 | 1 | 刷新花费的总时间(秒) |
elasticsearch_indices_refresh_total | 计数器 | 1 | 刷新总数 |
elasticsearch_indices_request_cache_count | 计数器 | 2 | 请求缓存命中/未命中计数 |
elasticsearch_indices_request_cache_evictions | 计数器 | 1 | 从请求缓存中逐出 |
elasticsearch_indices_request_cache_memory_size_bytes | 测量 | 1 | 请求缓存内存使用情况(以字节为单位) |
elasticsearch_indices_search_fetch_time_seconds | 计数器 | 1 | 总搜索获取时间(秒) |
elasticsearch_indices_search_fetch_total | 计数器 | 1 | 提取总数 |
elasticsearch_indices_search_query_time_seconds | 计数器 | 1 | 总搜索查询时间(秒) |
elasticsearch_indices_search_query_total | 计数器 | 1 | 查询总数 |
elasticsearch_indices_segments_count | 测量 | 1 | 此节点上的索引段计数 |
elasticsearch_indices_segments_memory_bytes | 测量 | 1 | 以字节为单位的段的当前内存大小 |
elasticsearch_indices_settings_stats_read_only_indices | 测量 | 1 | read_only_allow_delete=true的索引计数 |
elasticsearch_indices_settings_total_fields | 测量 | index . mapping . total _ fields . limit的索引设置值(索引中允许的映射字段总数) | |
elasticsearch_indices_settings_replicas | 测量 | index.replicas的索引设置值 | |
elasticsearch_indices_shards_docs | 测量 | 3 | 此碎片上的文档数 |
elasticsearch_indices_shards_docs_deleted | 测量 | 3 | 每个碎片上已删除文档的计数 |
elasticsearch_indices_store_size_bytes | 测量 | 1 | 存储的索引数据的当前大小(字节) |
elasticsearch_indices_store_size_bytes_primary | 测量 | 所有节点上仅包含主碎片的存储索引数据的当前大小(以字节为单位) | |
elasticsearch_indices_store_size_bytes_total | 测量 | 所有节点上所有碎片的存储索引数据的当前大小(字节) | |
elasticsearch_indices_store_throttle_time_seconds_total | 计数器 | 1 | 索引存储的节流时间(秒) |
elasticsearch_indices_translog_operations | 计数器 | 1 | translog操作总数 |
elasticsearch_indices_translog_size_in_bytes | 计数器 | 1 | 总传输日志大小(字节) |
elasticsearch_indices_warmer_time_seconds_total | 计数器 | 1 | 总升温时间(秒) |
elasticsearch_indices_warmer_total | 计数器 | 1 | 总加热器计数 |
elasticsearch_jvm_gc_collection_seconds_count | 计数器 | 2 | JVM GC运行计数 |
elasticsearch_jvm_gc_collection_seconds_sum | 计数器 | 2 | GC运行时间(秒) |
elasticsearch_jvm_memory_committed_bytes | 测量 | 2 | 区域当前提交的JVM内存 |
elasticsearch_jvm_memory_max_bytes | 测量 | 1 | JVM最大内存 |
elasticsearch_jvm_memory_used_bytes | 测量 | 2 | 区域当前使用的JVM内存 |
elasticsearch_jvm_memory_pool_used_bytes | 测量 | 3 | 当前由池使用的JVM内存 |
elasticsearch_jvm_memory_pool_max_bytes | 计数器 | 3 | 按池划分的JVM最大内存 |
elasticsearch_jvm_memory_pool_peak_used_bytes | 计数器 | 3 | 池使用的JVM内存峰值 |
elasticsearch_jvm_memory_pool_peak_max_bytes | 计数器 | 3 | 按池划分的JVM最大内存峰值 |
elasticsearch_os_cpu_percent | 测量 | 1 | 操作系统使用的CPU百分比 |
elasticsearch_os_load1 | 测量 | 1 | 短期平均负荷 |
elasticsearch_os_load5 | 测量 | 1 | 中期平均负荷 |
elasticsearch_os_load15 | 测量 | 1 | 长期平均负载 |
elasticsearch_process_cpu_percent | 测量 | 1 | 进程使用的CPU百分比 |
elasticsearch_process_cpu_seconds_total | 计数器 | 1 | 以秒为单位的处理CPU时间 |
elasticsearch_process_mem_resident_size_bytes | 测量 | 1 | 进程使用的常驻内存(字节) |
elasticsearch_process_mem_share_size_bytes | 测量 | 1 | 进程使用的共享内存(字节) |
elasticsearch_process_mem_virtual_size_bytes | 测量 | 1 | 使用的虚拟内存总量(字节) |
elasticsearch_process_open_files_count | 测量 | 1 | 打开文件描述符 |
elasticsearch_snapshot_stats_number_of_snapshots | 测量 | 1 | 快照总数 |
elasticsearch_snapshot_stats_oldest_snapshot_timestamp | 测量 | 1 | 最旧的快照时间戳 |
elasticsearch_snapshot_stats_snapshot_start_time_timestamp | 测量 | 1 | 上次快照开始时间戳 |
elasticsearch_snapshot_stats_latest_snapshot_timestamp_seconds | 测量 | 1 | 最新成功或部分快照的时间戳 |
elasticsearch_snapshot_stats_snapshot_end_time_timestamp | 测量 | 1 | 上次快照结束时间戳 |
elasticsearch_snapshot_stats_snapshot_number_of_failures | 测量 | 1 | 上次快照失败次数 |
elasticsearch_snapshot_stats_snapshot_number_of_indices | 测量 | 1 | 索引的最后快照数量 |
elasticsearch_snapshot_stats_snapshot_failed_shards | 测量 | 1 | 上次快照失败碎片 |
elasticsearch_snapshot_stats_snapshot_successful_shards | 测量 | 1 | 上次快照成功碎片 |
elasticsearch_snapshot_stats_snapshot_total_shards | 测量 | 1 | 上次快照总碎片 |
elasticsearch_thread_pool_active_count | 测量 | 14 | 线程池线程活动 |
elasticsearch_thread_pool_completed_count | 计数器 | 14 | 线程池操作已完成 |
elasticsearch_thread_pool_largest_count | 测量 | 14 | 线程池最大线程数 |
elasticsearch_thread_pool_queue_count | 测量 | 14 | 排队的线程池操作 |
elasticsearch_thread_pool_rejected_count | 计数器 | 14 | 线程池操作被拒绝 |
elasticsearch_thread_pool_threads_count | 测量 | 14 | 线程池当前线程计数 |
elasticsearch_transport_rx_packets_total | 计数器 | 1 | 接收的数据包计数 |
elasticsearch_transport_rx_size_bytes_total | 计数器 | 1 | 接收的总字节数 |
elasticsearch_transport_tx_packets_total | 计数器 | 1 | 发送的数据包计数 |
elasticsearch_transport_tx_size_bytes_total | 计数器 | 1 | 发送的总字节数 |
elasticsearch_clusterinfo_last_retrieval_success_ts | 测量 | 1 | 上次成功检索集群信息的时间戳 |
elasticsearch_clusterinfo_up | 测量 | 1 | 集群信息收集器的上升度量 |
elasticsearch_clusterinfo_version_info | 测量 | 6 | 以ES版本信息作为标签的常量度量 |
elasticsearch_slm_stats_up | 测量 | 0 | SLM收集器的向上度量 |
elasticsearch_slm_stats_total_scrapes | 计数器 | 0 | SLM收集器的刮削次数 |
elasticsearch_slm_stats_json_parse_failures | 计数器 | 0 | SLM收集器的JSON解析失败 |
elasticsearch_slm_stats_retention_runs_total | 计数器 | 0 | 总保留运行次数 |
elasticsearch_slm_stats_retention_failed_total | 计数器 | 0 | 失败的保留运行总数 |
elasticsearch_slm_stats_retention_timed_out_total | 计数器 | 0 | 总保留运行超时 |
elasticsearch_slm_stats_retention_deletion_time_seconds | 测量 | 0 | 保留运行删除时间 |
elasticsearch_slm_stats_total_snapshots_taken_total | 计数器 | 0 | 拍摄的快照总数 |
elasticsearch_slm_stats_total_snapshots_failed_total | 计数器 | 0 | 失败的快照总数 |
elasticsearch_slm_stats_total_snapshots_deleted_total | 计数器 | 0 | 删除的快照总数 |
elasticsearch_slm_stats_total_snapshots_failed_total | 计数器 | 0 | 失败的快照总数 |
elasticsearch_slm_stats_snapshots_taken_total | 计数器 | 1 | 策略拍摄的快照 |
elasticsearch_slm_stats_snapshots_failed_total | 计数器 | 1 | 策略导致快照失败 |
elasticsearch_slm_stats_snapshots_deleted_total | 计数器 | 1 | 策略删除的快照 |
elasticsearch_slm_stats_snapshot_deletion_failures_total | 计数器 | 1 | 按策略划分的快照删除失败 |
elasticsearch_slm_stats_operation_mode | 测量 | 1 | SLM操作模式(运行、停止、停止) |
elasticsearch_data_stream_stats_up | 测量 | 0 | 数据流收集的上行度量 |
elasticsearch_data_stream_stats_total_scrapes | 计数器 | 0 | 数据流统计的总抓取次数 |
elasticsearch_data_stream_stats_json_parse_failures | 计数器 | 0 | 数据流统计信息的解析失败次数 |
elasticsearch_data_stream_backing_indices_total | 测量 | 1 | 数据流的后备索引数 |
elasticsearch_data_stream_store_size_bytes | 测量 | 1 | 数据流支持索引的当前大小(以字节为单位) |