diff --git a/README.md b/README.md index 88944446..bac66881 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ * [《芋道 Spring Boot Dubbo 入门》](http://www.iocoder.cn/Spring-Boot/Dubbo/?github) 对应 [lab-30](https://github.com/YunaiV/SpringBoot-Labs/tree/master/lab-30) 。 * 《芋道 Spring Boot Motan 入门》计划中... +* 《芋道 Spring Boot WebService 入门》计划中... * 《芋道 Spring Boot SOFARPC 入门》计划中... * 《芋道 Spring Boot gRPC 入门》计划中... * 《芋道 Spring Boot RSocket 入门》计划中... diff --git a/lab-36/lab-36-prometheus-demo/pom.xml b/lab-36/lab-36-prometheus-demo/pom.xml new file mode 100644 index 00000000..db2a7271 --- /dev/null +++ b/lab-36/lab-36-prometheus-demo/pom.xml @@ -0,0 +1,35 @@ + + + + org.springframework.boot + spring-boot-starter-parent + 2.2.2.RELEASE + + + 4.0.0 + + lab-36-prometheus-demo + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.micrometer + micrometer-registry-prometheus + + + + diff --git a/lab-36/lab-36-prometheus-demo/src/main/java/cn/iocoder/springboot/lab36/prometheusdemo/Application.java b/lab-36/lab-36-prometheus-demo/src/main/java/cn/iocoder/springboot/lab36/prometheusdemo/Application.java new file mode 100644 index 00000000..5f359782 --- /dev/null +++ b/lab-36/lab-36-prometheus-demo/src/main/java/cn/iocoder/springboot/lab36/prometheusdemo/Application.java @@ -0,0 +1,13 @@ +package cn.iocoder.springboot.lab36.prometheusdemo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/lab-36/lab-36-prometheus-demo/src/main/resources/application.yaml b/lab-36/lab-36-prometheus-demo/src/main/resources/application.yaml new file mode 100644 index 00000000..a9e3cfda --- /dev/null +++ b/lab-36/lab-36-prometheus-demo/src/main/resources/application.yaml @@ -0,0 +1,14 @@ +spring: + application: + name: demo-application # 应用名 + +management: + endpoints: + # Actuator HTTP 配置项,对应 WebEndpointProperties 配置类 + web: + exposure: + include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 + + metrics: + tags: # 通用标签 + application: ${spring.application.name} diff --git a/lab-36/pom.xml b/lab-36/pom.xml new file mode 100644 index 00000000..67cebb44 --- /dev/null +++ b/lab-36/pom.xml @@ -0,0 +1,19 @@ + + + + labs-parent + cn.iocoder.springboot.labs + 1.0-SNAPSHOT + + 4.0.0 + + lab-36 + pom + + lab-36-prometheus-demo + + + + diff --git a/pom.xml b/pom.xml index 700345aa..8fb37919 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ lab-33 lab-34 lab-35 + lab-36