Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
}

tasks.named('test') {
Expand Down
20 changes: 20 additions & 0 deletions docker/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,25 @@ services:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci

prometheus:
image: prom/prometheus:latest
container_name: ticket-service-prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
depends_on:
- mysql

grafana:
image: grafana/grafana:latest
container_name: ticket-service-grafana
ports:
- "3000:3000"
volumes:
- ticket-service-grafana-data:/var/lib/grafana
depends_on:
- prometheus
volumes:
ticket-service-data:
ticket-service-grafana-data:
9 changes: 9 additions & 0 deletions docker/monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
global:
scrape_interval: 5s

scrape_configs:
- job_name: "ticket-service"
metrics_path: "/actuator/prometheus"
static_configs:
- targets:
- host.docker.internal:8080
8 changes: 7 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
spring:
application:
name: ticket-service
name: ticket-service

management:
endpoints:
web:
exposure:
include: health,metrics,prometheus