Skip to content

Commit

Permalink
Merge pull request #106 from DogCatWorldTeam/fix#105
Browse files Browse the repository at this point in the history
[fix] 모니터링 수정
  • Loading branch information
m3k0813 authored Aug 13, 2024
2 parents d905ff1 + 8ce65e9 commit 4215107
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 38 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ dependencies {
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'io.micrometer:micrometer-registry-prometheus'
}

def querydslSrcDir = 'src/main/generated'
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ services:
image: gcr.io/cadvisor/cadvisor
container_name: cadvisor
ports:
- 8080:8080
- 3100:3100
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
Expand Down
41 changes: 7 additions & 34 deletions elk/logstash/pipeline/logstash.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,12 @@ input {
}
}

filter {
grok {
match => [ "message" , "%{COMBINEDAPACHELOG}+%{GREEDYDATA:extra_fields}"]
overwrite => [ "message" ]
}
mutate {
convert => ["response", "integer"]
convert => ["bytes", "integer"]
convert => ["responsetime", "float"]
}
geoip {
source => "clientip"
target => "geoip"
add_tag => [ "nginx-geoip" ]
}
date {
match => [ "timestamp" , "dd/MMM/YYYY:HH:mm:ss Z" ]
remove_field => [ "timestamp" ]
}
useragent {
source => "agent"
}
}

output {
stdout{
codec => "dots"
}
elasticsearch{
hosts => ["elasticsearch:9200"]
index => "weblogs-%{+YYYY.MM.dd}"
user => "logstash_internal"
password => "changeme"
ecs_compatibility => disabled
}
elasticsearch {
hosts => "elasticsearch:9200"
index => "logstash-%{+yyyy.MM.dd}"
user => "elastic"
password => "elastic"
ecs_compatibility => disabled
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public SecurityFilterChain filterChain(HttpSecurity http, RedisService redisServ
.authorizeHttpRequests((auth) -> auth
.requestMatchers("/api/v1/users/login", "/api/v1/users/register", "/login", "/reissue",
"/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**", "/api/v1/pet-funeral",
"/api/v1/shelter/*", "/api/v1/shelter_address", "/api/v1/pet_board/**").permitAll()
"/api/v1/shelter/*", "/api/v1/shelter_address", "/api/v1/pet_board/**", "/actuator/prometheus").permitAll()
.anyRequest().authenticated());
// .anyRequest().permitAll());

Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ logging:
max-file-size: 10MB
max-history: 7
file:
name: ./log/server.log
name: ./log/server.log

management:
endpoints:
web:
exposure:
include: "prometheus"
5 changes: 4 additions & 1 deletion src/main/resources/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ scrape_configs:
- job_name: prometheus
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8080']
- targets: ['host.docker.internal:8080']
- job_name: 'cadvisor'
static_configs:
- targets: ['cadvisor:3100']

0 comments on commit 4215107

Please sign in to comment.