一、用到的工具
 
二、安装和运行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. ORACLE表空间offline谈起,表空间备份恢复

    从ORACLE表空间offline谈起,表空间备份恢复将表空间置为offline,可能的原因包括维护.备份恢复等目的:表空间处于offline状态,那么Oracle不会允许任何对该表空间中对象的SQL ...

  2. PHP会话

    B/S请求响应模式是无状态的.任意的请求间不存在任何的联系,不能将请求状态保持下去. 会话技术可以给每个浏览器分配持久数据,这些数据不会随着一次请求和相应结束而销毁. COOKIE cookie是一种 ...

  3. centos安装mycat(支持mysql8连接)

    1.参考前文安装jdk 2.官网 http://www.mycat.io/ 或 http://dl.mycat.io/ 下载 mycat1.6.7 release 版本 3.解压安装 cd /usr/ ...

  4. VMware 虚拟化编程(12) — VixDiskLib Sample 程序使用

    目录 目录 前文列表 vixDiskLibSample 安装 Sample 程序 Sample 程序使用方法 前文列表 VMware 虚拟化编程(1) - VMDK/VDDK/VixDiskLib/V ...

  5. C#—Nhibernate使用教程

    本篇文章,让我们一起来探索Nhibernate.首先我们去搜索Nhibernate下载地址,如下链接所示.该版本可能是最新版,我下载的4.0.4.GA.其中GA意思我没搞清楚.不过应该不重要.http ...

  6. nodejs 格式化 Date() 为yyyy-MM-dd HH:mm:ss 格式

    ===============2019-11-25更新======== 推荐:更实用完美解决时间格式化的 组件 monent 官网地址:http://momentjs.cn/ ============ ...

  7. 【Linux】limits.conf 不重启就生效或者不生效的原因

    前阵子,我要用到使LInux的文件打开数为65534个,而且需要永久生效,于是将配置写到了: vim /etc/security/limits.conf * soft nofile 65534* ha ...

  8. DataGridView数值列和日期列

    本文转自:http://www.cnblogs.com/conexpress/p/5923324.html 在使用DataGridView编辑数据的时候,编辑的单元格一般会显示为文本框,逻辑值和图片会 ...

  9. TensorFlow学习笔记8-深度学习的正则化

    深度学习的正则化 回顾一些基本概念 概念 描述 设计矩阵 数据集在特征向量上的表示 训练误差 学习到的模型与训练集标签之间的误差 泛化误差(测试误差) 学习到的模型与测试集之间的误差 欠拟合 模型的训 ...

  10. URIs, URLs, and URNs

    首先,URI,是uniform resource identifier,统一资源标识符,用来唯一的标识一个资源.而URL是uniform resource locator,统一资源定位器,它是一种具体 ...