一、用到的工具
 
二、安装和运行Prometheus
  1. 官网下载prometheus-2.9.1.linux-amd64.tar.gz并解压
       2. 配置(修改Prometheus目录下的prometheus.yml文件)
 
       3. 启动(nohup ./prometheus --config.file=prometheus.yml &)
 
       4. 访问(localhost:9090)
 
 
三、安装和运行Granfana
 
        yum localinstall grafana-6.2.5-1.x86_64.rpm  
 
     2. 启动(service grafana-server start)
 
     3. 访问(http://localhost:3000/,admin/admin)
 
     4. 添加Prometheus数据源   
 
     4. 添加Dashboard(4701)
 
 
四、创建SpringBoot应用
 
1. 添加如下依赖
<!--监控 begin-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--Micrometer-->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<!--监控 end-->

2. 配置监控

spring.application.name=bounter-monitor

## 暴露所有的actuator endpoints
management.endpoints.web.exposure.include=* ## Grafana上的应用名字
management.metrics.tags.application=${spring.application.name}
3. 打包并在服务器上运行
    nohup java -jar bounter-monitor &
 
4. 配置Prometheus endpoint
  # SpringBoot Application
- job_name: 'bounter-monitor'
scrape_interval: 5s
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['localhost:8080']
 
在做好以上步骤后,重启Prometheus就可以在Grafana看到jvm 监控数据了,如下图:
 
 
是不是觉得挺简单哉!那就赶快自己动手试试吧!
 
参考资料:

Prometheus + Grafana 监控SpringBoot应用的更多相关文章

  1. 【Springboot】用Prometheus+Grafana监控Springboot应用

    1 简介 项目越做越发觉得,任何一个系统上线,运维监控都太重要了.关于Springboot微服务的监控,之前写过[Springboot]用Springboot Admin监控你的微服务应用,这个方案可 ...

  2. Prometheus+Grafana监控SpringBoot

    Prometheus+Grafana监控SpringBoot 一.Prometheus监控SpringBoot 1.1 pom.xml添加依赖 1.2 修改application.yml配置文件 1. ...

  3. 基于Docker+Prometheus+Grafana监控SpringBoot健康信息

    在微服务体系当中,监控是必不可少的.当系统环境超过指定的阀值以后,需要提醒指定的运维人员或开发人员进行有效的防范,从而降低系统宕机的风险.在CNCF云计算平台中,Prometheus+Grafana是 ...

  4. cAdvisor+Prometheus+Grafana监控docker

    cAdvisor+Prometheus+Grafana监控docker 一.cAdvisor(需要监控的主机都要安装) 官方地址:https://github.com/google/cadvisor ...

  5. [转帖]Prometheus+Grafana监控Kubernetes

    原博客的位置: https://blog.csdn.net/shenhonglei1234/article/details/80503353 感谢原作者 这里记录一下自己试验过程中遇到的问题: . 自 ...

  6. prometheus+grafana监控redis

    prometheus+grafana监控redis redis安装配置 https://www.cnblogs.com/autohome7390/p/6433956.html redis_export ...

  7. prometheus+grafana监控mysql

    prometheus+grafana监控mysql 1.安装配置MySQL官方的 Yum Repository(有mysql只需设置监控账号即可) [root@localhost ~]# wget - ...

  8. [转帖]安装prometheus+grafana监控mysql redis kubernetes等

    安装prometheus+grafana监控mysql redis kubernetes等 https://www.cnblogs.com/sfnz/p/6566951.html plug 的模式进行 ...

  9. Prometheus + Grafana 监控系统搭

    本文主要介绍基于Prometheus + Grafana 监控Linux服务器. 一.Prometheus 概述(略) 与其他监控系统对比 1 Prometheus vs. Zabbix Zabbix ...

随机推荐

  1. elasticsearch 7.2 集群节点配置

    conf/elasticsearch.yml对其修改,在下面添加修改: 主节点的配置 http.cors.enabled: true http.cors.allow-origin: "*&q ...

  2. MySQL-default设置

    Both statements insert a value into the phone column, but the first inserts a NULL value and the sec ...

  3. flex 垃圾回收

    原文在这里:Garbage Collection with Flex and Adobe Air 我终于有时间来整理在flexcamp上演讲的东西并写篇博客了.就在flexcamp前一个月,我几乎天天 ...

  4. AngleSharp 网络数据采集 -- 使用AngleSharp做html解析

    AngleSharp        AngleSharp is a .NET library that gives you the ability to parse angle bracket bas ...

  5. vue猜数字游戏

    <!doctype html> <html> <head> <meta charset="UTF-8"> <title> ...

  6. java webservice - cxf使用总结 一

    1.创建maven项目 加入pom依赖 <dependency> <groupId>org.apache.cxf</groupId> <artifactId& ...

  7. 自己挖的坑自己填--docker创建实例出现Waiting for SSH to be available…

    在之前使用Docker for Windows Installer.exe直接安装,通过docker-machine-driver-vmwareworkstation.exe实现docker和VM的共 ...

  8. 离线安装 Cloudera ( CDH 5.x )(转载)

    要配置生产环境前,最好严格按照官方文档/说明配置环境.比如,官方说这个安装包用于RETHAT6, CENTOS6,那就要装到6的版本下,不然很容易出现各种各样的错. 配置这个CDH5我入了很多坑: C ...

  9. Spark-Core RDD转换算子-Value型

    1. map(func) 作用: 返回一个新的 RDD, 该 RDD 是由原 RDD 的每个元素经过函数转换后的值而组成. 就是对 RDD 中的数据做转换. 创建一个包含1-10的的 RDD,然后将每 ...

  10. JavaScript ES6中export、import与export default的用法和区别

    前言 相信很多人都使用过export.export default.import,然而它们到底有什么区别呢? 在看他们之间的区别之前,我们先来看看它们的用法. ES6 import和export的用法 ...