Skip to content

Commit

Permalink
[PPD-237] Added Actuator (#11)
Browse files Browse the repository at this point in the history
* [PPD-237] actuator

* Actuator
  • Loading branch information
jacopocarlini committed Jul 13, 2022
1 parent 4ce1f5c commit afe78f5
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ emulatorcert.crt
**/package-lock.json
**/node_modules/
**/yarn.lock
**/application-secret.properties
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
@Slf4j
public class LoggingAspect {

@Value("${application.name}")
@Value("${info.application.name}")
private String name;

@Value("${application.version}")
@Value("${info.application.version}")
private String version;

@Value("${properties.environment}")
@Value("${info.properties.environment}")
private String environment;

@Pointcut("@within(org.springframework.web.bind.annotation.RestController)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class SwaggerConfig {
public static final String HEADER_REQUEST_ID = "X-Request-Id";

@Bean
public OpenAPI customOpenAPI(@Value("${application.description}") String appDescription, @Value("${application.version}") String appVersion) {
public OpenAPI customOpenAPI(@Value("${info.application.description}") String appDescription, @Value("${info.application.version}") String appVersion) {
return new OpenAPI()
.components(new Components()
.addSecuritySchemes("ApiKey", new SecurityScheme()
Expand Down
12 changes: 3 additions & 9 deletions src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# info
properties.environment=dev

# Cosmos account config
azure.cosmos.uri=https://pagopa-d-weu-gps-cosmos-account.documents.azure.com:443/
azure.cosmos.key=<PUT_HERE_PRIMARY_KEY>
Expand All @@ -12,17 +9,14 @@ azure.cosmos.service-container-name=services

service.gpd.host=http://localhost:8085

# timeout
# Timeout
feign.client.config.default.connect-timeout=1000
feign.client.config.default.read-timeout=1000

# retry configuration
# Retry configuration
retry.maxAttempts=1
retry.maxDelay=200

# logging level settings
# Logging Level settings
logging.level.root=INFO
logging.level.it.gov.pagopa.spontaneouspayment=INFO



11 changes: 4 additions & 7 deletions src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# info
properties.environment=local

# Cosmos account config
azure.cosmos.uri=https://localhost:8081
azure.cosmos.key=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
Expand All @@ -12,14 +9,14 @@ azure.cosmos.service-container-name=services

service.gpd.host=http://localhost:8085

# timeout
# Timeout
feign.client.config.default.connect-timeout=1000
feign.client.config.default.read-timeout=1000

# retry configuration
# Retry configuration
retry.maxAttempts=1
retry.maxDelay=200

# logging level settings
# Logging Level settings
logging.level.root=INFO
logging.level.it.gov.pagopa.spontaneouspayment=INFO
logging.level.it.gov.pagopa.spontaneouspayment=INFO
37 changes: 19 additions & 18 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#cors
#spring_cors_origin=*
server.port=9090

# info
application.name=@project.artifactId@
application.version=@project.version@
application.description=@project.description@
properties.environment=azure
info.application.name=@project.artifactId@
info.application.version=@project.version@
info.application.description=@project.description@
info.properties.environment=none

# Server
server.port=9090
server.servlet.context-path=/pagopa-spontaneous-payments-service

# Cosmos account config
azure.cosmos.uri=${COSMOS_URI}
Expand All @@ -17,24 +17,25 @@ azure.cosmos.populate-query-metrics=${COSMOS_QUERY_METRICS}
azure.cosmos.ec-container-name=${EC_CONTAINER_NAME}
azure.cosmos.service-container-name=${SERVICE_CONTAINER_NAME}

# Service
service.gpd.host=${GPD_HOST}

# timeout
# Timeout
feign.client.config.default.connect-timeout=${CONNECTION_TIMEOUT}
feign.client.config.default.read-timeout=${CONNECTION_TIMEOUT}

# retry configuration
# Retry configuration
retry.maxAttempts=${RETRY_MAX_ATTEMPTS}
retry.maxDelay=${RETRY_MAX_DELAY}

# logging level settings
# Logging Level settings
logging.level.root=${LOGGING_LEVEL}
logging.level.it.gov.pagopa.spontaneouspayment=${LOGGING_LEVEL}


#jpa:
# spring.jpa.hibernate.ddl-auto=validate
# spring.jpa.show-sql=false
# spring.jpa.open-in-view=false
spring.devtools.add-properties=true
spring.profiles.active=@spring.profiles.active@
# Actuator
management.endpoints.web.exposure.include=health,info
management.endpoints.jmx.exposure.exclude=health,info
management.info.env.enabled=true
management.endpoint.health.probes.enabled=true
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true
10 changes: 5 additions & 5 deletions src/test/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# info
application.name=@project.artifactId@
application.version=@project.version@
application.description=@project.description@
properties.environment=JUNIT
info.application.name=@project.artifactId@
info.application.version=@project.version@
info.application.description=@project.description@
info.properties.environment=JUNIT

# Cosmos account config
azure.cosmos.uri=https://pagopa-d-gps-cosmos-account.documents.azure.com:443/
Expand All @@ -25,4 +25,4 @@ retry.maxDelay=200

# logging level settings
logging.level.root=INFO
logging.level.it.gov.pagopa.spontaneouspayment=INFO
logging.level.it.gov.pagopa.spontaneouspayment=INFO

0 comments on commit afe78f5

Please sign in to comment.