Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
79055415
提交
79055415
authored
5月 18, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 后端:集成 Prometheus
上级
17614d42
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
49 行增加
和
1 行删除
+49
-1
GlobalResponseBodyHandler.java
...ll/spring/boot/web/handler/GlobalResponseBodyHandler.java
+1
-1
pom.xml
pom.xml
+16
-0
pom.xml
system/system-application/pom.xml
+15
-0
MonitorConfiguration.java
...r/mall/admin/application/config/MonitorConfiguration.java
+9
-0
application.yaml
...em/system-application/src/main/resources/application.yaml
+8
-0
没有找到文件。
common/mall-spring-boot/src/main/java/cn/iocoder/mall/spring/boot/web/handler/GlobalResponseBodyHandler.java
浏览文件 @
79055415
...
...
@@ -18,7 +18,7 @@ public class GlobalResponseBodyHandler implements ResponseBodyAdvice {
if
(
returnType
.
getMethod
()
==
null
)
{
return
false
;
}
return
returnType
.
getMethod
().
getReturnType
()
.
isAssignableFrom
(
CommonResult
.
class
)
;
return
returnType
.
getMethod
().
getReturnType
()
==
CommonResult
.
class
;
}
@Override
...
...
pom.xml
浏览文件 @
79055415
...
...
@@ -58,6 +58,10 @@
<servlet.version>
2.5
</servlet.version>
<seata.version>
0.5.1
</seata.version>
<prometheus-spring-boot.version>
0.6.0
</prometheus-spring-boot.version>
<micrometer.version>
1.1.4
</micrometer.version>
<!-- <seata.version>0.6.0-SNAPSHOT</seata.version>-->
<java.version>
1.8
</java.version>
...
...
@@ -233,12 +237,24 @@
<artifactId>
spring-boot-admin-starter-client
</artifactId>
<version>
${spring-boot-admin-starter-client.version}
</version>
</dependency>
<dependency>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-registry-prometheus
</artifactId>
<version>
${micrometer.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-sentinel
</artifactId>
<version>
${sentinel.version}
</version>
</dependency>
<dependency>
<groupId>
io.prometheus
</groupId>
<artifactId>
simpleclient_spring_boot
</artifactId>
<version>
${prometheus-spring-boot.version}
</version>
</dependency>
<!-- Test 相关 -->
...
...
system/system-application/pom.xml
浏览文件 @
79055415
...
...
@@ -65,6 +65,21 @@
<artifactId>
spring-cloud-starter-alibaba-sentinel
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-registry-prometheus
</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.prometheus</groupId>-->
<!-- <artifactId>simpleclient_spring_boot</artifactId>-->
<!-- </dependency>-->
<!-- 测试相关 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
system/system-application/src/main/java/cn/iocoder/mall/admin/application/config/MonitorConfiguration.java
0 → 100644
浏览文件 @
79055415
package
cn
.
iocoder
.
mall
.
admin
.
application
.
config
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
//@EnablePrometheusEndpoint
//@EnableSpringBootMetricsCollector
public
class
MonitorConfiguration
{
}
system/system-application/src/main/resources/application.yaml
浏览文件 @
79055415
...
...
@@ -32,3 +32,11 @@ swagger:
description
:
管理员子系统
version
:
1.0.0
base-package
:
cn.iocoder.mall.admin.application.controller
management
:
endpoints
:
web
:
exposure
:
include
:
health,info,env,metrics,prometheus
metrics
:
enabled
:
true
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论