备忘录二:Spring Boot Actuator+Prometheus+Grafana
发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,一:Spring Boot ActuatorSpring-boot-actuator 可在将应用程序投入生产时监视和管理应用程序。可以选择使用 HTTP 端点或 JMX 来管理和监控应用程序Sprin
千家信息网最后更新 2026年11月03日备忘录二:Spring Boot Actuator+Prometheus+Grafana
一:Spring Boot Actuator
Spring-boot-actuator 可在将应用程序投入生产时监视和管理应用程序。可以选择使用 HTTP 端点或 JMX 来管理和监控应用程序
Spring boot 应用中引入 Spring-boot-actuator
org.springframework.boot spring-boot-starter-actuator
3.application.yml文件配置
# managementmanagement: endpoints: web: exposure: include: "*" endpoint: health: show-details: ALWAYS
4.Spring Boot Actuator内置Endpoints
二: Prometheus
将Micrometer Prometheus 注册添加到Spring Boot应用。
io.micrometer micrometer-registry-prometheus
2.Docker 拉取 Prometheus镜像
docker pull prom/prometheus
3. Prometheus 配置文件
# my global configglobal: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s).# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.rule_files: # - "first_rules.yml" # - "second_rules.yml"# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.scrape_configs: # The job name is added as a label `job=` to any timeseries scraped from this config. - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['127.0.0.1:9090'] - job_name: 'spring-actuator' metrics_path: '/mybatis/actuator/prometheus' scrape_interval: 5s static_configs: - targets: ['112.74.105.178:8888']
4.运行 Prometheus容器
docker run -d --name=prometheus -p 9090:9090 -v /mnt/demo/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml
5.查看 Prometheus运行情况
三:Grafana
Docker 运行Grafana镜像
docker run -d --name=grafana -p 3000:3000 grafana/grafana
2. Grafana 配置 Prometheus数据源
3.监控dashboard
应用
应用程序
程序
运行
配置
文件
镜像
监控
管理
可在
容器
情况
数据
数据源
端点
投入
生产
监视
选择
备忘录
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网黑科技
互联网科技公司简介
美国互联网保险保险科技
科技互联网公司装修
中资互联网科技
互联网科技的发展
合肥互联网科技公司
互联网科技英文
互联网科技公司电话
碳银互联网科技
卓越科技(互联网 )
互联网科技股午盘股票涨跌
互联网企业和科技型企业
中国航天科技大学国际工业互联网
杭州壁岐互联网科技有限公司
2021互联网科技公司排名
互联网企业科技类企业如何做账
互联网风格科技公司名称
唯美互联网科技
广东猫王互联网科技有限公司电话
河南真二互联网科技有限公司
科技服务与互联网
成都互联网科技公司
本届互联网博览会上的黑科技
科技类公司包括互联网吗
内蒙古九一互联网科技
伊宁互联网科技做什么的
互联网领先科技宣传片
互联网公司属于科技吗
互联网科技品牌