【问题标题】:How to connect Prometheus with Presto JMX如何将 Prometheus 与 Presto JMX 连接起来
【发布时间】:2019-08-10 05:22:56
【问题描述】:

我试图将 prometheus 与 Presto jmx 连接,我找到了这个导出器 https://github.com/yahoojapan/presto_exporter,但似乎提到的二进制文件不存在。 我的问题是如何从头开始创建 presto 导出器? 如果已经存在 jmx_exporter 可以提供帮助以及如何提供帮助?

非常感谢。

【问题讨论】:

    标签: jmx prometheus presto jmx-exporter


    【解决方案1】:

    #1 从源代码构建

    你需要自己构建go代码

    #2 Docker(推荐)

    例如,ip 使用内部网络 ip 以便 docker 容器可以访问它。

    # docker run --rm yahoojapan/presto-exporter:master --help
    # for more infomation
    docker run --rm -p 9483:9483 yahoojapan/presto-exporter:master --web.url="http://<ip>:8080/v1/cluster"
    

    然后在Prometheus

    scrape_configs:
    
      # other configurations...
    
      - job_name: 'presto_exporter'
        static_configs:
          - targets: ['<server_ip_that_run_docker_command>:9483']
    

    重启Prometheus

    查询presto_*或导入此仪表板:https://grafana.com/grafana/dashboards/10866


    更新

    还有更多不是以presto_开头的指标,见:http://&lt;server_ip_that_run_docker_command&gt;:9483/metrics

    【讨论】:

      【解决方案2】:

      没有 Docker,没有 presto-exporter docker 容器

      Prometheus 监控也可以在 presto jvm.config 文件中启用 JMX 选项

      -server
      -Xmx3G
      -XX:+UseG1GC
      -XX:G1HeapRegionSize=32M
      -XX:+UseGCOverheadLimit
      -XX:+ExplicitGCInvokesConcurrent
      -XX:+HeapDumpOnOutOfMemoryError
      -XX:+ExitOnOutOfMemoryError
      -Dcom.sun.management.jmxremote=true
      -Dcom.sun.management.jmxremote.port=9015
      -Dcom.sun.management.jmxremote.local.only=false
      -Dcom.sun.management.jmxremote.authenticate=false
      -Dcom.sun.management.jmxremote.ssl=false
      -javaagent:/opt/java_metrics/jmx_prometheus_javaagent-0.3.0.jar=9483:/opt/java_metrics/config.yml
      

      prometheus.yml文件中为presto添加Prometheus抓取点

      scrape_configs:
      
         - job_name: presto
           static_configs:
            - targets: ['<presto_ip>:9483']
      
      • Presto 指标将在http://&lt;presto_ip&gt;:9483/metrics 上提供

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-10-02
        • 2018-04-06
        • 2021-02-23
        • 2020-05-12
        • 2019-07-16
        • 2010-11-17
        • 2021-09-15
        相关资源
        最近更新 更多