• Prommetheus 插件监控 ES


    转载自:https://blog.csdn.net/u010453363/article/details/76689435/
    用prometheus主要是监控elk中的elasticsearch和logstash
    prometheus的clicent收集数据,并提供http服务,由prometheus server主动pull数据。
     
    1.1 elasticsearch数据由es插件
    实现: https://github.com/vvanholl/elasticsearch-prometheus-exporter
     
    1.1.1 插件下载
    目前试用的是es5.4,https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases 下载对应版本的插件
     
    1.1.2 安装插件
    sh ./bin/elasticsearch-plugin install file:///home/elk/elasticsearch-prometheus-exporter-5.4.0.0.zip ,重启es。
    默认指标目录:http://192.168.x.x:9200/_prometheus/metrics
    http://192.168.x.x:9200/_prometheus/metrics能够看到es的prometheus指标,说明插件安装成功。
     

    1.2配置prometheus server 来pull es数据
    # my global config
    global:
      scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
      evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
      # scrape_timeout is set to the global default (10s).
      # Attach these labels to any time series or alerts when communicating with
      # external systems (federation, remote storage, Alertmanager).
      external_labels:
          monitor: 'codelab-monitor'
    # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
    rule_files:
      # - "first.rules"
      # - "second.rules"
      #  - "prometheus.rules"
    # A scrape configuration containing exactly one endpoint to scrape:
    # Here it's Prometheus itself.
    scrape_configs:
      # es motitor
      - job_name: elasticsearch
        scrape_interval: 10s
        metrics_path: "/_prometheus/metrics"
        static_configs:
          - targets: ['192.168.x.x:9200']
     
    ps:es指标的路径必须为/_prometheus/metrics ,否则prometheus server拉取不到es的指标数据。

    到此 prometheus能够正常展示es指标。
  • 相关阅读:
    病毒写法,资源的释放.
    MinHook库的使用 64位下,过滤LoadLibraryExW
    系统权限远程线程注入到Explorer.exe
    【Unity】4.5 树木创建器
    【Unity】4.4 添加角色控制器
    【Unity】4.3 地形编辑器
    【Unity】4.2 提升开发效率的捷径--导入 Unity 5.3.4 自带的资源包
    【Unity】4.1 创建组件
    【Unity】4.0 第4章 创建基本的游戏场景
    【Unity】3.6 导入图片资源
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/13307342.html
Copyright © 2020-2023  润新知