Skip to content

Commit

Permalink
Merge pull request #86 from Alchive/feat/#84
Browse files Browse the repository at this point in the history
feat: grafana, prometheus, cadvisor 모니터링 추가
  • Loading branch information
dlwhsk0 authored Oct 30, 2024
2 parents 8bf7226 + 998cb89 commit f501e1d
Show file tree
Hide file tree
Showing 7 changed files with 3,996 additions and 54 deletions.
76 changes: 40 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,60 +1,64 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.hibernate.orm' version '6.4.4.Final'
id 'org.graalvm.buildtools.native' version '0.9.28'
id 'java'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.hibernate.orm' version '6.4.4.Final'
id 'org.graalvm.buildtools.native' version '0.9.28'
}

group = 'com.Alchive'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
targetCompatibility = '17'
sourceCompatibility = '17'
targetCompatibility = '17'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'mysql:mysql-connector-java:8.0.32'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// OAuth
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'

// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

// Validation - @NotBlank
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'mysql:mysql-connector-java:8.0.32'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// OAuth
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'

// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

// Validation - @NotBlank
implementation 'org.springframework.boot:spring-boot-starter-validation'

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

tasks.named('test') {
useJUnitPlatform()
useJUnitPlatform()
}

hibernate {
enhancement {
enableAssociationManagement = true
}
enhancement {
enableAssociationManagement = true
}
}

76 changes: 59 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,65 @@ services:
networks:
- alchive

# springboot:
# build:
# context: .
# dockerfile: Dockerfile
# restart: always
# depends_on:
# - mysql
# ports:
# - 8080:8080
# container_name: springboot
# environment:
# SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL}
# SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
# SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
# SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE}
# networks:
# - alchive
springboot:
container_name: springboot
build:
context: .
dockerfile: Dockerfile
restart: always
depends_on:
- mysql
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL}
SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE}
networks:
- alchive

# Monitoring
prometheus:
container_name: prometheus
image: prom/prometheus:latest
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- "9090:9090"
networks:
- alchive

grafana:
container_name: grafana
image: grafana/grafana:latest
volumes:
- ./monitoring/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./monitoring/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./monitoring/grafana/provisioning/dashboards:/var/lib/grafana/dashboards
ports:
- "3000:3000"
depends_on:
- prometheus
networks:
- alchive

cadvisor:
container_name: cadvisor
image: gcr.io/cadvisor/cadvisor:latest
ports:
- "8081:8081"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /var/run/docker.sock:/var/run/docker.sock
privileged: true
networks:
- alchive

networks:
alchive:
Expand Down
Loading

0 comments on commit f501e1d

Please sign in to comment.