File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323# ###########################################
2424# Environment / Secrets
2525# ###########################################
26- .env
26+ .env.dev
2727.env. *
2828* .env
2929* .key
Original file line number Diff line number Diff line change 1- version : " 3.9"
2-
31services :
42
53 postgres :
@@ -15,7 +13,7 @@ services:
1513 volumes :
1614 - vimaltech_pgdata:/var/lib/postgresql/data
1715 healthcheck :
18- test : [ "CMD-SHELL", "pg_isready -U contactuser -d contactdb" ]
16+ test : ["CMD-SHELL", "pg_isready -U contactuser -d contactdb"]
1917 interval : 10s
2018 timeout : 5s
2119 retries : 5
@@ -28,9 +26,30 @@ services:
2826 condition : service_healthy
2927 ports :
3028 - " 8080:8080"
29+ env_file :
30+ - .env.prod
3131 environment :
32- SPRING_PROFILES_ACTIVE : dev
32+ SPRING_PROFILES_ACTIVE : prod
33+ restart : unless-stopped
34+
35+ prometheus :
36+ image : prom/prometheus
37+ container_name : vimaltech-prometheus
38+ volumes :
39+ - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
40+ ports :
41+ - " 9090:9090"
42+ restart : unless-stopped
43+
44+ grafana :
45+ image : grafana/grafana
46+ container_name : vimaltech-grafana
47+ ports :
48+ - " 3000:3000"
49+ volumes :
50+ - grafana_data:/var/lib/grafana
3351 restart : unless-stopped
3452
3553volumes :
36- vimaltech_pgdata:
54+ vimaltech_pgdata :
55+ grafana_data:
Original file line number Diff line number Diff line change 110110 <groupId >org.springframework.boot</groupId >
111111 <artifactId >spring-boot-starter-data-redis</artifactId >
112112 </dependency >
113+
114+ <dependency >
115+ <groupId >org.springframework.boot</groupId >
116+ <artifactId >spring-boot-starter-actuator</artifactId >
117+ </dependency >
118+
119+ <dependency >
120+ <groupId >io.micrometer</groupId >
121+ <artifactId >micrometer-registry-prometheus</artifactId >
122+ </dependency >
113123 </dependencies >
114124
115125 <build >
Original file line number Diff line number Diff line change 1+ global :
2+ scrape_interval : 15s
3+
4+ scrape_configs :
5+ - job_name : ' contact-api'
6+
7+ metrics_path : /actuator/prometheus
8+
9+ static_configs :
10+ - targets : ['contact-api:8080']
Original file line number Diff line number Diff line change @@ -35,4 +35,18 @@ logging:
3535 root : WARN
3636 com.vimaltech.contactapi : INFO
3737 org.springframework : WARN
38- org.hibernate : WARN
38+ org.hibernate : WARN
39+
40+ management :
41+ endpoints :
42+ web :
43+ exposure :
44+ include : health,info,prometheus
45+
46+ endpoint :
47+ health :
48+ show-details : never
49+
50+ metrics :
51+ tags :
52+ application : contact-api
You can’t perform that action at this time.
0 commit comments