备忘录二: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安全错误
数据库的锁怎样保障安全
精品咖啡豆
互联网科技企业
喔噻互联网科技有限公司
上海睿民互联网科技有限公司
广州大一互联网络科技有限公司
互联网科技媒体
卓越科技(互联网 )
友谊互联网络科技
互联网金融 科技创新
科技类的互联网平台
老年人脱离互联网科技的作文
青岛中康互联网医疗科技有限公司
广州恒生互联网科技有限
扫呗互联网科技有限公司
互联网科技平台产品运营
互联网界的黑科技
中国科技和美国互联网
科技信息时代互联网发展
玉溪新华互联网科技怎么选
互联网企业和网络科技有限公司
广州互联网络科技有限公司
互联网校园科技培训
科技互联网大厂
移动互联网科技公司
苏州铭阳互联网科技有限公司
浙南科技城互联网大厦建设工程
企晟互联网信息科技有限公司
美国互联网科技实力
北京市互联网新科技
瑞安市蟠桃会互联网科技有限公司