diff --git a/k8s/release/monitoring.yaml b/k8s/release/monitoring.yaml new file mode 100644 index 00000000..246b9940 --- /dev/null +++ b/k8s/release/monitoring.yaml @@ -0,0 +1,16 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: spring-boot-app-monitor + namespace: monitoring +spec: + selector: + matchLabels: + app: spring-boot-app + namespaceSelector: + matchNames: + - grass-diary-backend-release + endpoints: + - port: 80 + path: /actuator/prometheus + interval: 15s diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index cbdae857..1925da50 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -33,8 +33,9 @@ cloud.aws.region.statics=ap-northeast-2 cloud.aws.stack.auto=false # actuator-monitoring-config -#management.endpoints.web.exposure.include=* -#management.endpoint.health.show-details: always +management.endpoints.web.exposure.include=health,info,prometheus +management.endpoint.prometheus.enabled=true + # JPA/Hibernate-statistics #spring.jpa.properties.hibernate.generate_statistics=true @@ -48,4 +49,4 @@ spring.mail.username=${MAIL_USER_ID} spring.mail.password=${MAIL_USER_PW} spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true -spring.mail.default-encoding=UTF-8 \ No newline at end of file +spring.mail.default-encoding=UTF-8