Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
f29d427f
提交
f29d427f
authored
5月 20, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 后端:引入下 Metrics 相关的包
上级
733433e7
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
109 行增加
和
22 行删除
+109
-22
pom.xml
common/mall-spring-boot/pom.xml
+13
-0
MetricsAutoConfiguration.java
...er/mall/spring/boot/metrics/MetricsAutoConfiguration.java
+24
-0
spring.factories
...-spring-boot/src/main/resources/META-INF/spring.factories
+2
-1
pom.xml
order/order-application/pom.xml
+9
-2
pom.xml
pay/pay-application/pom.xml
+9
-2
pom.xml
product/product-application/pom.xml
+10
-0
pom.xml
promotion/promotion-application/pom.xml
+10
-0
pom.xml
search/search-application/pom.xml
+10
-0
pom.xml
system/system-application/pom.xml
+0
-5
MonitorConfiguration.java
...r/mall/admin/application/config/MonitorConfiguration.java
+0
-9
PageSmsSignBO.java
.../java/cn/iocoder/mall/admin/api/bo/sms/PageSmsSignBO.java
+1
-2
PageSmsTemplateBO.java
...a/cn/iocoder/mall/admin/api/bo/sms/PageSmsTemplateBO.java
+1
-1
pom.xml
user/user-application/pom.xml
+12
-0
application.yaml
user/user-application/src/main/resources/application.yaml
+8
-0
没有找到文件。
common/mall-spring-boot/pom.xml
浏览文件 @
f29d427f
...
...
@@ -60,6 +60,19 @@
<optional>
true
</optional>
</dependency>
<!-- 监控相关 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-actuator-autoconfigure
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-registry-prometheus
</artifactId>
<optional>
true
</optional>
</dependency>
</dependencies>
</project>
common/mall-spring-boot/src/main/java/cn/iocoder/mall/spring/boot/metrics/MetricsAutoConfiguration.java
0 → 100644
浏览文件 @
f29d427f
package
cn
.
iocoder
.
mall
.
spring
.
boot
.
metrics
;
import
io.micrometer.core.instrument.MeterRegistry
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@ConditionalOnClass
({
MeterRegistryCustomizer
.
class
})
@ConditionalOnProperty
(
prefix
=
"management.metrics"
,
value
=
"enable"
,
matchIfMissing
=
true
)
// 允许使用 management.metrics.enable=false 禁用 Metrics
public
class
MetricsAutoConfiguration
{
@Value
(
"${spring.application.name}"
)
private
String
applicationName
;
@Bean
MeterRegistryCustomizer
<
MeterRegistry
>
metricsCommonTags
()
{
return
registry
->
registry
.
config
().
commonTags
(
"application"
,
applicationName
);
}
}
common/mall-spring-boot/src/main/resources/META-INF/spring.factories
浏览文件 @
f29d427f
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.iocoder.mall.spring.boot.web.AdminMVCAutoConfiguration, \
cn.iocoder.mall.spring.boot.web.UserMVCAutoConfiguration, \
cn.iocoder.mall.spring.boot.swagger.SwaggerAutoConfiguration
cn.iocoder.mall.spring.boot.swagger.SwaggerAutoConfiguration, \
cn.iocoder.mall.spring.boot.metrics.MetricsAutoConfiguration
order/order-application/pom.xml
浏览文件 @
f29d427f
...
...
@@ -59,13 +59,20 @@
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-sentinel
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-sentinel
</artifactId>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-registry-prometheus
</artifactId>
</dependency>
<!-- 测试相关 -->
...
...
pay/pay-application/pom.xml
浏览文件 @
f29d427f
...
...
@@ -66,13 +66,20 @@
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-sentinel
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-sentinel
</artifactId>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-registry-prometheus
</artifactId>
</dependency>
</dependencies>
...
...
product/product-application/pom.xml
浏览文件 @
f29d427f
...
...
@@ -65,6 +65,16 @@
<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>
org.springframework.boot
</groupId>
...
...
promotion/promotion-application/pom.xml
浏览文件 @
f29d427f
...
...
@@ -76,6 +76,16 @@
<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>
org.springframework.boot
</groupId>
...
...
search/search-application/pom.xml
浏览文件 @
f29d427f
...
...
@@ -65,6 +65,16 @@
<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>
org.springframework.boot
</groupId>
...
...
system/system-application/pom.xml
浏览文件 @
f29d427f
...
...
@@ -75,11 +75,6 @@
<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
deleted
100644 → 0
浏览文件 @
733433e7
package
cn
.
iocoder
.
mall
.
admin
.
application
.
config
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
//@EnablePrometheusEndpoint
//@EnableSpringBootMetricsCollector
public
class
MonitorConfiguration
{
}
system/system-service-api/src/main/java/cn/iocoder/mall/admin/api/bo/sms/PageSmsSignBO.java
浏览文件 @
f29d427f
package
cn
.
iocoder
.
mall
.
admin
.
api
.
bo
.
sms
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
...
...
@@ -28,7 +27,7 @@ public class PageSmsSignBO {
@Data
@Accessors
(
chain
=
true
)
public
class
Sign
{
public
static
class
Sign
{
/**
* 编号
*/
...
...
system/system-service-api/src/main/java/cn/iocoder/mall/admin/api/bo/sms/PageSmsTemplateBO.java
浏览文件 @
f29d427f
...
...
@@ -25,7 +25,7 @@ public class PageSmsTemplateBO {
@Data
@Accessors
(
chain
=
true
)
public
class
Template
{
public
static
class
Template
{
/**
* 编号
*/
...
...
user/user-application/pom.xml
浏览文件 @
f29d427f
...
...
@@ -62,6 +62,18 @@
<artifactId>
swagger-bootstrap-ui
</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>
org.springframework.boot
</groupId>
...
...
user/user-application/src/main/resources/application.yaml
浏览文件 @
f29d427f
...
...
@@ -18,3 +18,11 @@ server:
swagger
:
enable
:
false
management
:
endpoints
:
web
:
exposure
:
include
:
health,info,env,metrics,prometheus
metrics
:
enabled
:
true
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论