Skip to content

Commit

Permalink
Actuator added and tested.
Browse files Browse the repository at this point in the history
  • Loading branch information
Badri Paudel committed Jul 7, 2024
1 parent 9ad36c8 commit ec3b4e7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,11 @@ MVC

## Deploy full stack Spring Boot application in elastic bean stalk [checkout to local branch]

### Actuator
- To access actuator endpoint, hit /actuator and you'll see all the available endpoints. By default, only /actuator/health is enabled.
- To get all other endpoints, include "management.endpoints.web.exposure.include=*" in application.properties file.
- For example, now you can access: /actuator/metrics, it will give all the metrics information which you can
use to see additional information. Like copy name displayed in /metrics and append that as : metrics/hikaricp.connections
- This will give hikari connection pool info like total no of connections. And other ppts will give other important information.

10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Include prometheus for monitoring -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
Expand Down
9 changes: 8 additions & 1 deletion src/main/resources/application-default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spring.servlet.multipart.max-request-size=10MB
#properties to send the mail using spring boot

# TLS , port 587
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.enable=false

spring.mail.host=smtp.gmail.com
spring.mail.port=587
Expand All @@ -39,3 +39,10 @@ spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.connectiontimeout=5000
spring.mail.properties.mail.smtp.timeout=5000
spring.mail.properties.mail.smtp.writetimeout=5000

# Expose other endpoints for actuator
management.endpoints.web.exposure.include=*

#prometheus
# TODO: implement prometheus later.
management.endpoint.prometheus.enabled=true
3 changes: 3 additions & 0 deletions src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.connectiontimeout=5000
spring.mail.properties.mail.smtp.timeout=5000
spring.mail.properties.mail.smtp.writetimeout=5000

# Expose other endpoints for actuator
management.endpoints.web.exposure.include=*

0 comments on commit ec3b4e7

Please sign in to comment.