prometheus整合elasticsearch_exporter

下载

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.uri1.0.2我们应该连接的Elasticsearch节点的地址(主机和端口)。这可以是本地节点(localhost:9200或者远程Elasticsearch服务器的地址。当需要基本身份验证时,指定为:😕/:@:。例如,http://admin:pass@localhost:9200。用户凭证中的特殊字符需要进行URL编码。http://本地主机:9200
es.all1.0.2如果为true,则查询集群中所有节点的统计信息,而不仅仅是我们连接到的节点。False
es.cluster_settings1.1.0rc1如果为真,则查询集群设置的统计信息。False
es.indices1.0.2如果为真,则查询集群中所有索引的统计信息。False
es.indices_settings1.0.4rc1如果为真,则查询集群中所有索引的设置统计信息。False
es.indices_mappings1.2.0如果为真,则查询集群所有索引映射的统计信息。False
es.aliases1.0.4rc1如果为真,请包括信息别名指标。True
es.shards1.0.3rc1如果为真,查询集群中所有索引的统计信息,包括分片级别的统计信息(意味着es.indices=true).False
es.snapshots1.0.4rc1如果为真,则查询集群快照的统计信息。False
es.slm如果为真,则查询SLM的统计信息。False
es.data_stream如果为真,则查询数据流的状态。False
es.timeout1.0.2尝试从Elasticsearch获取统计数据超时。(例如:20多岁)5s
es.ca1.0.2包含Elasticsearch连接的可信证书颁发机构的PEM文件的路径。
es.client-private-key1.0.2连接到Elasticsearch时包含客户端身份验证私钥的PEM文件的路径。
es.client-cert1.0.2PEM文件的路径,该文件包含连接到Elasticsearch的私钥的相应证书。
es.clusterinfo.interval1.1.0rc1集群标签的集群信息更新间隔5m
es.ssl-skip-verify1.0.4rc1连接到Elasticsearch时跳过SSL验证。False
web.listen-address1.0.2web界面和遥测监听的地址。:9114
web.telemetry-path1.0.2公开指标的路径。/指标
aws.region1.5.0AWS弹性搜索区域
aws.role-arn1.6.0要承担的IAM角色的角色ARN。
version1.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 defaultscluster monitor所有群集只读操作,如群集健康和状态、热线程、节点信息、节点和群集统计信息以及挂起的群集任务。
es.cluster_settingscluster monitor
es.indicesindices monitor (per index or *)监控所需的所有操作(恢复、数据段信息、索引统计和状态)
es.indices_settingsindices monitor (per index or *)
es.indices_mappingsindices view_index_metadata (per index or *)
es.shardsnot sure if indices or cluster monitor or both
es.snapshotscluster:admin/snapshot/status and cluster:admin/repository/getES论坛帖子
es.slmread_slm
es.data_streammonitor 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计数器1get 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测量1read_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计数器1translog操作总数
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计数器2JVM GC运行计数
elasticsearch_jvm_gc_collection_seconds_sum计数器2GC运行时间(秒)
elasticsearch_jvm_memory_committed_bytes测量2区域当前提交的JVM内存
elasticsearch_jvm_memory_max_bytes测量1JVM最大内存
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测量0SLM收集器的向上度量
elasticsearch_slm_stats_total_scrapes计数器0SLM收集器的刮削次数
elasticsearch_slm_stats_json_parse_failures计数器0SLM收集器的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测量1SLM操作模式(运行、停止、停止)
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数据流支持索引的当前大小(以字节为单位)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值