一、用到的工具
 
二、安装和运行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. 几个FFmpeg 视频参数 fps、tbr、tbn、tbc

    我们用Ffplay播放文件或者视频流命令行会出现fps.tbr.tbn.tbc等参数如下图所示 图1 ffplay 播放文件示意图 fps表示平均帧率,总帧数除以总时长(以s为单位). tbr  表示 ...

  2. Java-小技巧-006 List 排序 Collections.sort()

    一.数组操作类:Arrays 最早开始使用,查看方法二分查找:public static int binarySearch(数据类型[] a, 数据类型 key) 前提是有序的 equals 先排序 ...

  3. dict用法

    1 dict.items() https://www.runoob.com/python3/python3-att-dictionary-items.html 2 setdefault的用法 注意se ...

  4. 红米4高配版 qusb bulk unknow device 不加电,不亮灯,没反应的 黑砖 的维修方法

    unknow device处理 1. 按住按住音量减键和开机键3分钟左右  (我按了10秒左右,就成功了.) unknow device 就变qualcomm hs-usb qdloader 9008 ...

  5. delphi中如何实现文件的复制?

    http://zhidao.baidu.com/link?url=nyAzCpeXAbaT8M3qqAePCF1Zr7q-oK4hpAUNIaRYpHcbmIwYsLr1TXoTt8759HtR1EB ...

  6. MySQL 编码:utf8 与 utf8mb4,utf8mb4_unicode_ci 与 utf8mb4_general_ci

    参考:mysql字符集小结 utf8mb4 已成为 MySQL 8.0 的默认字符集,在MySQL 8.0.1及更高版本中将 utf8mb4_0900_ai_ci 作为默认排序规则. 新项目只考虑 u ...

  7. Java ——Character 类

    本节重点思维导图 Character 类用于对单个字符进行操作. Character 类在对象中包装一个基本类型 char 的值 char ch = 'a'; // Unicode 字符表示形式 ch ...

  8. Learn Python the hard way, ex45 对象、类、以及从属关系

    #!/usr/bin/python #coding:utf-8 # animal is-a object(yes,sort of sonfusing)look at the extra credit ...

  9. 5G调研与总结

    5G的重点是: 将极大地超越现有的4G,主要包括速度,时延,带宽,能耗等方面 传输速度的快速提高(相对于4G来说提升了近10倍),在万物物联上的作用会更大 由于传速度快,让各种远程操控成为了可能(AR ...

  10. Leveldb--Slice

    http://www.kuqin.com/database/20110919/265041.html Slice非常简单的数据结构,它包括length和一个指向外部字节数组的指针.为什么使用Slice ...