惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Threatpost
GbyAI
GbyAI
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
B
Blog
量子位
Scott Helme
Scott Helme
P
Proofpoint News Feed
NISL@THU
NISL@THU
Y
Y Combinator Blog
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
PCI Perspectives
PCI Perspectives
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cloudbric
Cloudbric
L
LangChain Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
S
Secure Thoughts
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
AWS News Blog
AWS News Blog
C
Check Point Blog
Hacker News: Ask HN
Hacker News: Ask HN
雷峰网
雷峰网
F
Full Disclosure
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
O
OpenAI News
博客园 - 叶小钗
N
News | PayPal Newsroom
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Vercel News
Vercel News
小众软件
小众软件

博客园 - 陈惟鲜的博客

win11安装mysql8 AI软件修改脚本与代码,还真不敢完全操作 linux 磁盘满了,排查 Ecelipse 安装 MAT linux 增加新磁盘 redis自身查询很慢 排查redis-benchmark prometheus监控mysql数据库 监控工具prometheus配置-docker版 linux 文件属性被替换修改查询并修改 ----i----------- ZonedDateTime 转为 java.util.Date docker 容器查看jvm参数配置 redis 事务处理,一旦异常,则回滚 linux 下安装使用jmeter 执行压测 大批量订单来了由于入库慢,先缓存后通知入库 eclipse 合并错分支代码还原,合并到本分支但未push到库上 mysql 查询jason格式数据 maven打包慢,使用maven-mvnd 打包可以快一半 postman 参数化构建 批量测试 postman 常用参数例子 使用AOP实现+自定义注解 实现 缓存 如何判断redis慢了
prometheus监控springboot项目配置
陈惟鲜的博客 · 2024-08-13 · via 博客园 - 陈惟鲜的博客

项目运行状况,如果想要了解,那么项目需要增加如下配置,才能被prometheus发现。

1、pom.xml增加maven依赖

我这项目是maven项目,所以增加的是maven依赖。我这做了统一的版本管理,所以依赖信息中的version去掉了。

        <!--监控prometheus -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
          <groupId>io.micrometer</groupId>
          <artifactId>micrometer-registry-prometheus</artifactId>
        </dependency>

2、yml配置文件中,增加监控发现配置。

#监控
# Actuator
management:
  endpoints.web.exposure.include: "*"
# Prometheus
  metrics.tags.application: ${spring.application.name}

这里会用到

4、在prometheus.yml中增加项目访问信息。

 5、重启prometheus,访问target列表

如果正确配置,那么就会展示在列表上。

至此项目发现配置完成。