-
Notifications
You must be signed in to change notification settings - Fork 3
Metric Design
pp edited this page Jul 17, 2024
·
14 revisions
Test Monitoring 관련으로 메트릭 디자인하면서 진행했던 내용 공유
USE/RED는 메트릭 디자인 방법론의 종류.
USE는 물리적 하드웨어(서버) 위주의 메트릭 디자인 방법을,
RED는 어플리케이션 레벨의 메트릭 디자인 방법을 제시함.
For every resource, check utilization, saturation, and errors.
- 모든 자원에 대해서 점유율, 포화율, 오류를 확인하자.
- 주로 물리적 자원에 대한 메트릭을 수집하는데 사용되는 기준이라고 이해함.
-
Resource(자원): 물리적 서버의 모든 기능 구성 요소 -
Utilization(점유율): 리소스가 서비스에 대하여 바쁘게 사용되는 평균 시간
-> 점유율이 높다 = 리소스가 처리되지않고 밀려있을 가능성(bottle neck 등)이 있다. -
Saturation(포화율): 리소스가 처리하지 못한 여분의 일(extra work)의 정도. 리소스가 처리할 수 있는 한계를 넘어 처리하지 못한 작업의 정도. -
Errors(오류): 에러 이벤트의 횟수 - 세 지표를 사용해서 낮은 레벨의(서버의 물리적 자원 - 네트워크) 모니터링이 가능하다.
CPU 점유율은 낮은데 포화율이 높다? -> 스레드나 프로세스 분배가 잘못되어 있어서 하나의 CPU 코어에 일이 몰려있다. -> 스레드 풀을 사용해서 하나의 스레드에 몰린 작업을 분배하는 등의 조치를 취할 수 있음.
-
Pros: -
Cons:
“The USE Method doesn’t really apply to services; it applies to hardware, network disks, things like this,”
“We really wanted a microservices-oriented monitoring philosophy, so we came up with the RED Method.”
- USE와
USE/RED 방법론을 참고해서 사용할 시스템에 적합한 메트릭 선정하기

- Backend App (Spring Actuator)
- Frontend App (Node Exporter)
- Nginx (Nginx Exporter)
- Opensearch (Opensearch Exporter)
- MySQL (MySQL Exporter)
- Redis (Redis Exporter)
- Node: Springboot, Vue.js 등의 동작하는 WorkerNode 모니터링 (Node Exporter)
- Spring Acutator (http://localhost:8080/metrics)
{
"names": [
"application.ready.time",
"application.started.time",
"disk.free",
"disk.total",
"executor.active",
"executor.completed",
"executor.pool.core",
"executor.pool.max",
"executor.pool.size",
"executor.queue.remaining",
"executor.queued",
"http.server.requests",
"http.server.requests.active",
"jvm.buffer.count",
"jvm.buffer.memory.used",
"jvm.buffer.total.capacity",
"jvm.classes.loaded",
"jvm.classes.unloaded",
"jvm.compilation.time",
"jvm.gc.live.data.size",
"jvm.gc.max.data.size",
"jvm.gc.memory.allocated",
"jvm.gc.memory.promoted",
"jvm.gc.overhead",
"jvm.gc.pause",
"jvm.info",
"jvm.memory.committed",
"jvm.memory.max",
"jvm.memory.usage.after.gc",
"jvm.memory.used",
"jvm.threads.daemon",
"jvm.threads.live",
"jvm.threads.peak",
"jvm.threads.started",
"jvm.threads.states",
"logback.events",
"process.cpu.time",
"process.cpu.usage",
"process.start.time",
"process.uptime",
"system.cpu.count",
"system.cpu.usage",
"tomcat.sessions.active.current",
"tomcat.sessions.active.max",
"tomcat.sessions.alive.max",
"tomcat.sessions.created",
"tomcat.sessions.expired",
"tomcat.sessions.rejected"
]
}
Q. CD과정도 모니터링이 필요한지?
-> 실제 환경에서도 배포는 주로 사용자가 적은 야간에 진행할 거 같은데
이걸 모니터링하는게 의미가 있을지 모르겠음
- 🤝 Collaboration
- 💬 Git Commit Convention
- 🌿 Branching Strategy
- 🔀 Pull Request (PR) Guidelines
- 🐋 Docker
- 🎡 Kubernetes
- 🔎 Metrics
- 💊 USE/RED
- 📝 Metrics Design
- 🔥 Prometheus
- 🦖 Grafana
- ⚒️ 실제 구현