File tree Expand file tree Collapse file tree
java/io/github/devopsws/demo Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ Run E2E testing:
77make build-image test-e2e
88```
99
10+ Run with Maven command:
11+
12+ ``` shell
13+ mvn spring-boot:run
14+ ```
15+
1016## OpenAPI definition
1117You can visit it via: http://localhost:8080/v3/api-docs
1218
@@ -17,3 +23,6 @@ You can visit it via: http://localhost:8080/graphiql?path=/graphql
1723
1824## tRPC
1925The [ tRPC] ( https://github.com/trpc-group/trpc-java ) endpoint is: ` http://localhost:9090 `
26+
27+ ## Metrics
28+ You can visit the metrics endpoint: ` /actuator/prometheus `
Original file line number Diff line number Diff line change 9494 expect :
9595 bodyFieldsExpect :
9696 message : rick
97+ - name : prometheus
98+ request :
99+ api : /actuator/prometheus
100+ header :
101+ Authorization : " {{ .param.auth }}"
Original file line number Diff line number Diff line change 4747 <version >1.1.0</version >
4848 </dependency >
4949
50+ <dependency >
51+ <groupId >org.springframework.boot</groupId >
52+ <artifactId >spring-boot-starter-actuator</artifactId >
53+ </dependency >
54+ <dependency >
55+ <groupId >io.micrometer</groupId >
56+ <artifactId >micrometer-registry-prometheus</artifactId >
57+ </dependency >
58+
5059 <dependency >
5160 <groupId >org.springframework.boot</groupId >
5261 <artifactId >spring-boot-starter-test</artifactId >
Original file line number Diff line number Diff line change 11package io .github .devopsws .demo ;
22
33import com .tencent .trpc .spring .boot .starters .annotation .EnableTRpc ;
4+
45import org .springframework .boot .SpringApplication ;
56import org .springframework .boot .autoconfigure .SpringBootApplication ;
67
Original file line number Diff line number Diff line change 1919 ip : 0.0.0.0 # Listen ip
2020 port : 9090 # Listen port
2121 network : tcp # Network type, tcp or udp
22+
23+ # https://spring.academy/guides/spring-spring-prometheus
24+ management :
25+ endpoints :
26+ web :
27+ exposure :
28+ include : health, metrics, prometheus
29+ metrics :
30+ tags :
31+ application : ${spring.application.name}
You can’t perform that action at this time.
0 commit comments