Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: monitoring setting #49

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
81 changes: 81 additions & 0 deletions compose-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
version: '3.8'

services:
chzz-mysql:
image: mysql:latest
container_name: chzz-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 1234
MYSQL_DATABASE: chzzdb
TZ: Asia/Seoul
character-set-server: 'utf8mb4'
collation-server: 'utf8mb4_unicode_ci'
ports:
- "3308:3306"
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/conf.d:/etc/mysql/conf.d
command:
- "mysqld"
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_unicode_ci"

chzz-redis:
container_name: chzz-redis
image: redis:latest
restart: always
ports:
- "6379:6379"

chzz-frontend:
image: junest1010/test-app:latest
container_name: react-app
ports:
- "3000:3000"

node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
ports:
- "9100:9100"

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

grafana:
image: grafana/grafana:latest
container_name: grafana
volumes:
- ./monitoring/grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
ports:
- "3001:3000"

loki:
image: grafana/loki:latest
container_name: loki
ports:
- "3100:3100"
volumes:
- ./monitoring/loki:/etc/loki
- ./monitoring/loki-data:/tmp/loki
command: -config.file=/etc/loki/loki-config.yaml
39 changes: 39 additions & 0 deletions monitoring/loki/loki-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
auth_enabled: false

server:
http_listen_port: 3100

ingester:
wal:
dir: /tmp/loki/wal
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s

schema_config:
configs:
- from: 2020-05-15
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 168h

storage_config:
boltdb:
directory: /tmp/loki/index

filesystem:
directory: /tmp/loki/chunks

limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
14 changes: 14 additions & 0 deletions monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
global:
scrape_interval: 15s

scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'node_exporter'
static_configs:
- targets: ['host.docker.internal:9100']
- job_name: 'chzz-market-app'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8080']
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class SecurityConfig {
public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception {
return http.authorizeHttpRequests(authorize -> authorize
.requestMatchers(ACTUATOR).permitAll()
.requestMatchers("/metrics").permitAll()
.requestMatchers(GET,
"/api/v1/auctions",
"/api/v1/auctions/{auctionId:\\d+}",
Expand Down
Loading