prometheus 监控 jar应用服务 + 修改监听IP和端口

时间:2019-10-16 17:54:19   收藏:0   阅读:448

1.修改服务的启动脚本

[root@do1cloud01 init.d]# vim learn-school
nohup ${JAVA_HOME}/bin/java -javaagent:/usr/local/prometheus_jmx_export_0.3.1/jmx_prometheus_javaagent-0.3.1.jar=40016:/usr/local/prometheus_jmx_export_0.3.1/simple-config.yml $JAVA_OPTS -jar $DEPLOY_JAR --spring.cloud.consul.discovery.hostname=${HOST_NAME} --spring.cloud.consul.host=$consul_host --server.port=${ACTIVE_PORT} --logging.file=$LOG_FILE > /dev/null 2>&1 &

2.cat  /usr/local/prometheus_jmx_export_0.3.1/simple-config.yml

---
rules:
 - pattern: .*

3.修改Prometheus的监听ip和端口

[root@do1cloud03 system]# vim prometheus.service
--config.file=/usr/local/prometheus/prometheus.yml --web.listen-address=192.168.1.144:9090

 4.Prometheus的监控配置

  - job_name: jarauth44
    static_configs:
      - targets: [192.168.1.44:40015]
        labels:
          instance: auth
      - targets: [192.168.1.44:40016]
        labels:
          instance: learn

 参考:https://www.jianshu.com/p/8a5e681b18ce

原文:https://www.cnblogs.com/hixiaowei/p/11686876.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!