1+ <!DOCTYPE html>
2+ < html lang ="en " xmlns:th ="http://www.thymeleaf.org " xmlns ="http://www.w3.org/1999/html ">
3+ < head >
4+ < link rel ="stylesheet "
5+ href ="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css "/>
6+ < link rel ="stylesheet "
7+ href ="https://cdnjs.cloudflare.com/ajax/libs/prism/9000.0.1/themes/prism.min.css "/>
8+ < link href ="https://fonts.googleapis.com/css2?family=Lato:ital,wght@1,400;1,700&display=swap " rel ="stylesheet ">
9+ < script src ="https://code.jquery.com/jquery-3.3.1.min.js "> </ script >
10+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js "> </ script >
11+ < script src ="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js "> </ script >
12+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/prism/9000.0.1/prism.min.js "> </ script >
13+ </ head >
14+ < body >
15+ < div class ="container ">
16+ < div class ="card ">
17+ < div class ="card-body ">
18+ < h4 class ="card-title " th:text ="'Temporal Java SDK Samples: ' + ${sample} "> Temporal Java SDK Samples</ h4 >
19+ < h6 > In this sample we show how to set up and consume SDK metrics.</ h6 >
20+ < br /> < br /> < br />
21+ < div >
22+ < h6 > Configuring SDK metrics is super easy using < a href ="https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html " target ="_blank "> Spring Actuator</ a > </ h6 > < br />
23+ < div class ="list-group ">
24+ < a href ="# " class ="list-group-item list-group-item-action flex-column align-items-start ">
25+ < div class ="d-flex w-100 justify-content-between ">
26+ < h5 class ="mb-1 "> 1. Add spring-boot-starter-actuator to project dependencies</ h5 >
27+ </ div >
28+ < p class ="mb-1 ">
29+ < pre > < code > Gradle:
30+ < br /> implementation "org.springframework.boot:spring-boot-starter-actuator"
31+ </ code > </ pre >
32+ < pre > < code > Maven:
33+ < br /> <dependency>
34+ <groupId>org.springframework.boot</groupId>
35+ <artifactId>spring-boot-starter-actuator</artifactId>
36+ </dependency>
37+ </ code > </ pre >
38+ </ p >
39+ </ a >
40+ < a href ="# " class ="list-group-item list-group-item-action flex-column align-items-start ">
41+ < div class ="d-flex w-100 justify-content-between ">
42+ < h5 class ="mb-1 "> 2. Add micrometer-registry-prometheus as runtime dependency</ h5 >
43+ </ div >
44+ < p class ="mb-1 ">
45+ < pre > < code > Gradle:
46+ < br /> runtimeOnly "io.micrometer:micrometer-registry-prometheus"
47+ </ code > </ pre >
48+ < pre > < code > Maven:
49+ < br /> <dependency>
50+ <groupId> io.micrometer</groupId>
51+ <artifactId> micrometer-registry-prometheus</artifactId>
52+ <scope> runtime</scope>
53+ </dependency>
54+ </ code > </ pre >
55+ </ p >
56+ </ a >
57+ < a href ="# " class ="list-group-item list-group-item-action flex-column align-items-start ">
58+ < div class ="d-flex w-100 justify-content-between ">
59+ < h5 class ="mb-1 "> 3. Configure Actuator in application properties/yaml</ h5 >
60+ </ div >
61+ < p class ="mb-1 ">
62+ < pre > < code > management:
63+ endpoints:
64+ web:
65+ exposure:
66+ include: prometheus
67+ </ code > </ pre >
68+ < small class ="text-muted "> Alternatively, you can define a custom io.micrometer.core.instrument.MeterRegistry bean in the application context.</ small >
69+ </ a >
70+ < a href ="# " class ="list-group-item list-group-item-action flex-column align-items-start ">
71+ < div class ="d-flex w-100 justify-content-between ">
72+ < h5 class ="mb-1 "> 4. View metrics (Prometheus format)</ h5 >
73+ </ div >
74+ < p > Actuator will expose SDK metrics automatically.< br />
75+ You can access raw metrics at "localhost:3030/actuator/prometheus".< br />
76+ This is already set up for the samples project.
77+ </ p >
78+ < small class ="text-muted "> You can set up Prometheus config to scrape SDK metrics from this endpoint.</ small >
79+ </ a >
80+ </ div >
81+ </ div >
82+ </ div >
83+ </ div >
84+ </ div >
85+ </ body >
86+ </ html >
0 commit comments