

# PERF02-BP03 컴퓨팅 관련 지표 수집
<a name="perf_compute_hardware_collect_compute_related_metrics"></a>

 컴퓨팅 관련 지표를 기록하고 추적하여 컴퓨팅 리소스의 성능을 더 잘 파악하고 성능과 사용률을 높입니다.

 **일반적인 안티 패턴**: 
+  지표에 대해 수동 로그 파일 검색만 사용합니다.  
+  해당 모니터링 소프트웨어에서 기록한 기본 지표만 사용합니다.
+  문제가 발생한 경우에만 지표를 검토합니다.

 **이 모범 사례 확립의 이점:** 성능 관련 지표를 수집하면 애플리케이션 성능을 비즈니스 요구 사항에 맞게 조정하여 워크로드 필요 사항을 충족하는 데 도움이 됩니다. 또한 워크로드의 리소스 성능과 사용률을 지속적으로 개선하는 데 도움이 될 수 있습니다.

 **이 모범 사례가 확립되지 않을 경우 노출되는 위험 수준:** 높음 

## 구현 가이드
<a name="implementation-guidance"></a>

 클라우드 워크로드를 통해 지표, 로그 및 이벤트와 같은 대량의 데이터가 생성될 수 있습니다. AWS 클라우드에서 지표 수집은 보안, 비용 효율성, 성능 및 지속 가능성을 개선하기 위한 중요한 단계입니다. AWS는 [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/)와 같은 모니터링 서비스를 통해 다양한 성능 관련 지표를 제공하여 중요한 인사이트를 제공합니다. CPU 사용률, 메모리 사용률, 디스크 I/O, 네트워크 인바운드 및 아웃바운드와 같은 지표는 사용률 수준 또는 성능 병목 현상에 대한 인사이트를 제공할 수 있습니다. 데이터 기반 접근 방식의 일환으로 이 지표를 사용하면 워크로드 리소스를 능동적으로 튜닝하고 최적화할 수 있습니다.   비용 및 운영 목표를 지원하기 위해 보존 정책이 구현된 단일 플랫폼에서 컴퓨팅 리소스와 관련된 모든 지표를 수집하는 것이 이상적입니다.

## 구현 단계
<a name="implementation-steps"></a>
+  워크로드와 관련된 성능 관련 지표를 파악합니다. 리소스 사용률과 클라우드 워크로드의 운영 방식(응답 시간 및 처리량 등)에 대한 지표를 수집해야 합니다.
  +  [Amazon EC2 기본 지표](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html) 
  +  [Amazon ECS 기본 지표](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-metrics.html) 
  +  [Amazon EKS 기본 지표](https://docs.aws.amazon.com/prescriptive-guidance/latest/implementing-logging-monitoring-cloudwatch/kubernetes-eks-metrics.html) 
  +  [Lambda 기본 지표](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-access-metrics.html) 
  +  [Amazon EC2 메모리 및 디스크 지표](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html) 
+  워크로드에 적합한 로깅 및 모니터링 솔루션을 선택하고 설정합니다.
  +  [AWS 네이티브 관찰성](https://catalog.workshops.aws/observability/en-US/aws-native) 
  +  [AWS Distro for OpenTelemetry](https://aws.amazon.com/otel/) 
  +  [Amazon Managed Service for Prometheus](https://docs.aws.amazon.com/grafana/latest/userguide/prometheus-data-source.html) 
+  워크로드 요구 사항에 따라 지표에 필요한 필터 및 집계를 정의합니다.
  +  [Quantify custom application metrics with Amazon CloudWatch Logs and metric filters](https://aws.amazon.com/blogs/mt/quantify-custom-application-metrics-with-amazon-cloudwatch-logs-and-metric-filters/) 
  +  [Collect custom metrics with Amazon CloudWatch strategic tagging](https://aws.amazon.com/blogs/infrastructure-and-automation/collect-custom-metrics-with-amazon-cloudwatch-strategic-tagging/) 
+  보안 및 운영 목표에 맞게 지표에 대한 데이터 보존 정책을 구성합니다.
  +  [CloudWatch 지표에 대한 기본 데이터 보존](https://aws.amazon.com/cloudwatch/faqs/#AWS_resource_.26_custom_metrics_monitoring) 
  +  [CloudWatch Logs에 대한 기본 데이터 보존](https://aws.amazon.com/cloudwatch/faqs/#Log_management) 
+  필요한 경우 지표에 대한 경보 및 알림을 생성하여 성능 관련 문제에 미리 대응할 수 있습니다.
  +  [Create alarms for custom metrics using Amazon CloudWatch anomaly detection](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/create-alarms-for-custom-metrics-using-amazon-cloudwatch-anomaly-detection.html) 
  +  [Create metrics and alarms for specific web pages with Amazon CloudWatch RUM](https://aws.amazon.com/blogs/mt/create-metrics-and-alarms-for-specific-web-pages-amazon-cloudwatch-rum/) 
+  자동화를 사용하여 지표 및 로그 집계 에이전트를 배포합니다.
  +  [AWS Systems Manager 자동화](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation.html?ref=wellarchitected) 
  +  [OpenTelemetry Collector](https://aws-otel.github.io/docs/getting-started/collector) 

## 리소스
<a name="resources"></a>

 **관련 문서**: 
+  [모니터링 및 관찰성](https://aws.amazon.com/cloudops/monitoring-and-observability/) 
+  [Best practices: implementing observability with AWS](https://aws.amazon.com/blogs/mt/best-practices-implementing-observability-with-aws/) 
+  [Amazon CloudWatch 설명서](https://docs.aws.amazon.com/cloudwatch/index.html?ref=wellarchitected) 
+  [CloudWatch 에이전트를 사용하여 Amazon EC2 인스턴스 및 온프레미스 서버에서 지표 및 로그 수집](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html?ref=wellarchitected) 
+  [AWS Lambda에 대한 Amazon CloudWatch logs 액세스](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-logs.html?ref=wellarchitected) 
+  [컨테이너 인스턴스와 함께 CloudWatch Logs 사용](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_cloudwatch_logs.html?ref=wellarchitected) 
+  [사용자 지정 지표 게시](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html?ref=wellarchitected) 
+  [AWS Answers: Centralized Logging](https://aws.amazon.com/answers/logging/centralized-logging/?ref=wellarchitected) 
+  [CloudWatch 지표를 게시하는 AWS 서비스](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html?ref=wellarchitected) 
+  [Monitoring Amazon EKS on AWS Fargate](https://aws.amazon.com/blogs/containers/monitoring-amazon-eks-on-aws-fargate-using-prometheus-and-grafana/) 

 **관련 비디오:** 
+  [AWS re:Invent 2023 – [LAUNCH] Application monitoring for modern workloads](https://www.youtube.com/watch?v=T2TovTLje8w) 
+  [AWS re:Invent 2023 – Implementing application observability](https://www.youtube.com/watch?v=IcTcwUSwIs4) 
+  [AWS re:Invent 2023 – Building an effective observability strategy](https://www.youtube.com/watch?v=7PQv9eYCJW8) 
+  [AWS re:Invent 2023 – Seamless observability with AWS Distro for OpenTelemetry](https://www.youtube.com/watch?v=S4GfA2R0N_A) 
+  [Application Performance Management on AWS](https://www.youtube.com/watch?v=5T4stR-HFas&ref=wellarchitected) 

 **관련 예제:** 
+  [AWS for Linux Workloads Immersion Day- Amazon CloudWatch](https://catalog.us-east-1.prod.workshops.aws/workshops/a8e9c6a6-0ba9-48a7-a90d-378a440ab8ba/en-US/300-cloudwatch) 
+  [Monitoring Amazon ECS clusters and containers](https://ecsworkshop.com/monitoring/) 
+  [Monitoring with Amazon CloudWatch dashboards](https://catalog.workshops.aws/well-architected-performance-efficiency/en-US/3-monitoring/monitoring-with-cloudwatch-dashboards) 
+  [Amazon EKS 워크숍](https://www.eksworkshop.com/) 