From 6fb2a995642849935723eb3a7ed009d51b6773de Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Sat, 25 May 2024 18:37:59 -0700 Subject: [PATCH] feat: multiple enhancements (#75) probes access logs health --- .../templates/deployment.yaml | 19 +++++++++++++++++-- .../java/ca/bc/gov/nrs/api/Application.java | 1 + src/main/resources/application.properties | 7 +++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/charts/nr-oracle-service/templates/deployment.yaml b/charts/nr-oracle-service/templates/deployment.yaml index f99bcdf..4e8c14d 100644 --- a/charts/nr-oracle-service/templates/deployment.yaml +++ b/charts/nr-oracle-service/templates/deployment.yaml @@ -61,12 +61,27 @@ spec: protocol: TCP livenessProbe: httpGet: - path: / + path: /health port: http + timeoutSeconds: 5 + periodSeconds: 30 + initialDelaySeconds: 20 + failureThreshold: 6 readinessProbe: httpGet: - path: / + path: /health port: http + timeoutSeconds: 5 + periodSeconds: 10 + initialDelaySeconds: 5 + startupProbe: + httpGet: + path: /health + port: http + timeoutSeconds: 5 + periodSeconds: 10 + failureThreshold: 6 + resources: {{- toYaml .Values.resources | nindent 12 }} env: diff --git a/src/main/java/ca/bc/gov/nrs/api/Application.java b/src/main/java/ca/bc/gov/nrs/api/Application.java index 5d1629a..154189f 100644 --- a/src/main/java/ca/bc/gov/nrs/api/Application.java +++ b/src/main/java/ca/bc/gov/nrs/api/Application.java @@ -27,6 +27,7 @@ public Application(QueryExecutorService queryExecutorService) { } @GET + @Path("health") public Response healthCheck() { var result = queryExecutorService.healthCheck(); if (result == 0) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9b5ca88..2e1f199 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -14,10 +14,13 @@ quarkus.http.port=${HTTP_PORT:3000} %dev.quarkus.datasource.jdbc.url=jdbc:oracle:thin:@${DB_HOST}:1521/${DB_NAME} api.key=${API_KEY} quarkus.http.access-log.enabled=${ACCESS_LOG_ENABLED:false} +quarkus.http.access-log.pattern=%h %l %u %t "%R" %s %b "%{i,Referer}" "%{i,User-Agent}" +quarkus.http.access-log.exclude-pattern=/health quarkus.native.additional-build-args=-march=compatibility quarkus.swagger-ui.enable=true quarkus.swagger-ui.always-include=true quarkus.native.add-all-charsets=true -# Trigger build. - +#Logging +quarkus.log.level=${LOGGING_LEVEL:INFO} +quarkus.console.color=true