Skip to content

Commit

Permalink
feat: Install a scouter (APM) for performance analysis. (#158)
Browse files Browse the repository at this point in the history
* chore: add scouter java agent and configuration file

* chore: add scouter java agent command to jib 'jvmFlags' option

* refactor: remove unused condition
  • Loading branch information
KAispread authored Oct 10, 2023
1 parent b6262df commit f4b3da8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ jib {
}
container {
creationTime = 'USE_CURRENT_TIMESTAMP'
jvmFlags = ['-XX:+UseContainerSupport', '-Dserver.port=8080', '-Dfile.encoding=UTF-8', '-Duser.timezone=Asia/Seoul']
jvmFlags = ['-javaagent:/scouter.agent.jar', '-Dscouter.config=/spring-scouter.conf',
'-XX:+UseContainerSupport', '-Dserver.port=8080', '-Dfile.encoding=UTF-8', '-Duser.timezone=Asia/Seoul']
ports = ['8080']
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ public class AwsSmsCredentialService implements SmsCredentialService {
public void issue(String receiveTarget) {
ValueOperations<String, String> operations = redisTemplate.opsForValue();
String credential = RandomCodeUtils.crateCredential();

if (receiveTarget.equals("+821057710167")) {
credential = "999999";
}

sendSms(receiveTarget, credential);

operations.set(receiveTarget, credential, Duration.ofMinutes(10));
Expand Down
Binary file added src/main/jib/scouter.agent.jar
Binary file not shown.
12 changes: 12 additions & 0 deletions src/main/jib/spring-scouter.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Network
net_collector_ip=10.0.0.29
net_collector_udp_port=6100
net_collector_tcp_port=6100

# Object
obj_host_name=prod
obj_name=wemeet-prod-server

# Trace
trace_interservice_enabled=true
trace_http_client_ip_header_key=X-Forwarded-For

0 comments on commit f4b3da8

Please sign in to comment.