

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# CloudWatch의 Apache Airflow 환경 지표
<a name="access-metrics-cw"></a>

Apache Airflow v2 및 v3는 이미 Amazon Managed Workflows for Apache Airflow 환경에 대한 [StatSD](https://github.com/etsy/statsd) 지표를 수집하여 Amazon CloudWatch로 전송하도록 설정되어 있습니다. Apache Airflow가 전송하는 지표의 전체 목록은 *Apache Airflow 참조 가이드*의 [지표](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/metrics.html) 페이지에서 확인할 수 있습니다. 이 페이지에서는 CloudWatch에서 사용할 수 있는 Apache Airflow 지표와 CloudWatch 콘솔에서 지표에 액세스하는 방법을 설명합니다.

**Contents**
+ [용어](#access-metrics-cw-terms)
+ [측정 기준](#metrics-dimensions)
+ [CloudWatch 콘솔의 지표 액세스](#access-metrics-cw-console)
+ [CloudWatch에서 사용할 수 있는 Apache Airflow 지표](#available-metrics-cw)
  + [Apache Airflow 카운터](#counters-metrics)
  + [Apache Airflow 게이지](#gauges-metrics)
  + [Apache Airflow 타이머](#timers-metrics)
+ [보고할 지표 선택](#choosing-metrics)
+ [다음 단계](#mwaa-metrics202-next-up)

## 용어
<a name="access-metrics-cw-terms"></a>

**네임스페이스**  
네임스페이스는 AWS 서비스의 CloudWatch 지표를 위한 컨테이너입니다. Amazon MWAA의 경우 네임스페이스는 *AmazonMWAA*입니다.

**CloudWatch 지표**  
CloudWatch 지표는 CloudWatch에 고유한 시간 순서별 데이터 포인트 세트를 나타냅니다.

**Apache Airflow 지표**  
Apache Airflow 전용 [지표](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/metrics.html )

**측정 기준**  
차원은 지표의 보안 인증에 속하는 명칭/값 쌍입니다.

**단위**  
통계에는 측정 단위가 포함되어 있습니다. Amazon MWAA의 경우, 단위에는 *개수*, *초*, *밀리초*가 포함됩니다. Amazon MWAA의 경우, 단위는 원래의 Airflow 지표의 단위를 기반으로 설정됩니다.

## 측정 기준
<a name="metrics-dimensions"></a>

이 섹션에서는 CloudWatch의 Apache Airflow 지표에 사용되는 CloudWatch *차원*을 그룹화하는 방법에 대해 설명합니다.


| 차원 | 설명 | 
| --- | --- | 
| DAG | 특정 Apache Airflow DAG 이름을 나타냅니다. | 
| DAG 파일 이름 | 특정 Apache Airflow DAG 파일 이름을 나타냅니다. | 
| 함수 | 이 차원은 CloudWatch의 지표 그룹화를 개선하는 데 사용됩니다. | 
| 작업 | 스케줄러가 실행하는 Apache Airflow 작업을 나타냅니다. 항상 `Job`의 값을 갖습니다. | 
| 연산자 | 특정 Apache Airflow 연산자를 나타냅니다. | 
| 풀 | 특정 Apache Airflow 작업자 풀을 나타냅니다. | 
| 작업 | 특정 Apache Airflow 작업을 나타냅니다. | 
| HostName | 실행 중인 특정 Apache Airflow 프로세스의 호스트 이름을 나타냅니다. | 

## CloudWatch 콘솔의 지표 액세스
<a name="access-metrics-cw-console"></a>

이 섹션에서는 CloudWatch에서 특정 DAG의 성능 지표에 액세스하는 방법을 설명합니다.

**차원에 대한 성능 지표에 액세스하려면**

1. CloudWatch 콘솔에서 [지표 페이지](https://console.aws.amazon.com/cloudwatch/home#metricsV2:graph=~())를 엽니다.

1. 를 선택합니다 AWS 리전.

1. **Amazon MWAA** 네임스페이스를 선택합니다.

1. **모든 지표** 탭에서 차원을 선택합니다. 예: *DAG, 환경*

1. 차원에 대한 CloudWatch 지표를 선택합니다. 예: *TaskInstanceSuccesses* 또는 *TaskInstanceDuration* **모든 검색 결과를 그래프로 표시**를 선택합니다.

1. **그래프 지표** 탭을 선택하면 *DAG, 환경, 작업*과 같은 Apache Airflow 지표에 대한 성능 통계에 액세스할 수 있습니다.

## CloudWatch에서 사용할 수 있는 Apache Airflow 지표
<a name="available-metrics-cw"></a>

이 섹션에서는 CloudWatch로 전송되는 Apache Airflow 지표 및 차원에 대해 설명합니다.

### Apache Airflow 카운터
<a name="counters-metrics"></a>

이 섹션의 Apache Airflow 지표에는 [Apache Airflow *카운터*](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/metrics.html#counters)에 대한 데이터가 포함되어 있습니다.


| CloudWatch 지표 | Apache Airflow 지표 | 단위 | 측정 기준 | 
| --- | --- | --- | --- | 
| SLAMissed Apache Airflow v2.4.3\~v2.10.3에서만 사용할 수 있습니다.  | sla\_missed | 개수 | 함수, 스케줄러 | 
| FailedSLACallback Apache Airflow v2.4.3\~v2.10.3에서만 사용할 수 있습니다.  | sla\_callback\_notification\_failure | 개수 | 함수, 스케줄러 | 
| 업데이트 Apache Airflow v2.6.3 이상에서 사용 가능.  | dataset.updates | 개수 | 함수, 스케줄러 | 
| Orphaned Apache Airflow v2.6.3 이상에서 사용 가능.  | dataset.orphaned | 개수 | 함수, 스케줄러 | 
| FailedCeleryTaskExecution Apache Airflow v2.4.3 이상에서 사용 가능.  | celery.execute\_command.failure | 개수 | 함수, Celery | 
| FilePathQueueUpdateCount Apache Airflow v2.6.3 이상에서 사용 가능.  | dag\_processing.file\_path\_queue\_update\_count | 개수 | 함수, 스케줄러 | 
| CriticalSectionBusy | scheduler.critical\_section\_busy | 개수 | 함수, 스케줄러 | 
| DagBagSize | dagbag\_size | 개수 | 함수, DAG 프로세싱  | 
| DagCallbackExceptions | dag.callback\_exceptions | 개수 | DAG, 모두  | 
| FailedSLAEmailAttempts Apache Airflow v3.0.6 이상에서 사용 불가.  | sla\_email\_notification\_failure | 개수 | 함수, 스케줄러 | 
| TaskInstanceFinished | ti.finish.{dag\_id}.{task\_id}.{state} | 개수 | DAG, {dag\_id}<br />작업, {task\_id}<br />상태, {state} | 
| JobEnd | {job\_name}\_end | 개수 | 작업, {job\_name} | 
| JobHeartbeatFailure | {job\_name}\_heartbeat\_failure | 개수 | 작업, {job\_name} | 
| JobStart | {job\_name}\_start | 개수 | 작업, {job\_name} | 
| ManagerStalls | dag\_processing.manager\_stalls | 개수 | 함수, DAG 프로세싱  | 
| OperatorFailures | operator\_failures\_{operator\_name} | 개수 | 연산자, {operator\_name} | 
| OperatorSuccesses | operator\_successes\_{operator\_name} | 개수 | 연산자, {operator\_name} | 
| OtherCallbackCount Apache Airflow v2.6.3 이상에서 사용 가능.  | dag\_processing.other\_callback\_count | 개수 | 함수, 스케줄러 | 
| 프로세스 | dag\_processing.processes | 개수 | 함수, DAG 프로세싱  | 
| SchedulerHeartbeat | scheduler\_heartbeat | 개수 | 함수, 스케줄러 | 
| StartedTaskInstances | ti.start.{dag\_id}.{task\_id} | 개수 | DAG, 모두 <br />작업, 모두 | 
| SlaCallbackCount | dag\_processing.sla\_callback\_count Apache Airflow v2.6.3 이상에서 사용 가능.  | 개수 | 함수, 스케줄러 | 
| TasksKilledExternally | scheduler.tasks.killed\_externally | 개수 | 함수, 스케줄러 | 
| TaskTimeoutError | celery.task\_timeout\_error | 개수 | 함수, Celery | 
| TaskInstanceCreatedUsingOperator | task\_instance\_created-{operator\_name} | 개수 | 연산자, {operator\_name} | 
| TaskInstancePreviouslySucceeded | previously\_succeeded | 개수 | DAG, 모두 <br />작업, 모두 | 
| TaskInstanceFailures | ti\_failures | 개수 | DAG, 모두 <br />작업, 모두 | 
| TaskInstanceSuccesses | ti\_successes | 개수 | DAG, 모두 <br />작업, 모두 | 
| TaskRemovedFromDAG | task\_removed\_from\_dag.{dag\_id} | 개수 | DAG, {dag\_id} | 
| TaskRestoredToDAG | task\_restored\_to\_dag.{dag\_id} | 개수 | DAG, {dag\_id} | 
| TriggersSucceeded Apache Airflow v2.7.2 이상에서 사용 가능.  | triggers.succeeded | 개수 | 함수, 트리거 | 
| TriggersFailed Apache Airflow v2.7.2 이상에서 사용 가능.  | triggers.failed | 개수 | 함수, 트리거 | 
| TriggersBlockedMainThread Apache Airflow v2.7.2 이상에서 사용 가능.  | triggers.blocked\_main\_thread | 개수 | 함수, 트리거 | 
| TriggerHeartbeat Apache Airflow v2.8.1 이상에서 사용 가능.  | triggerer\_heartbeat | 개수 | 함수, 트리거러 | 
| TaskInstanceCreatedUsingOperator | airflow.task\_instance\_created\_`{operator_name}` Apache Airflow v2.7.2 이상에서 사용 가능.  | 개수 | 연산자, `{operator_name}`  | 
| ZombiesKilled | zombies\_killed | 개수 | DAG, 모두 <br />작업, 모두 | 

### Apache Airflow 게이지
<a name="gauges-metrics"></a>

[이 섹션의 Apache Airflow 지표에는 Apache Airflow *게이지*에 대한 데이터가 포함되어 있습니다](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/metrics.html#gauges).


| CloudWatch 지표 | Apache Airflow 지표 | 단위 | 측정 기준 | 
| --- | --- | --- | --- | 
| DAGFileRefreshError | dag\_file\_refresh\_error | 개수 | 함수, DAG 프로세싱  | 
| ImportErrors | dag\_processing.import\_errors | 개수 | 함수, DAG 프로세싱  | 
| ExceptionFailures | smart\_sensor\_operator.exception\_failures | 개수 | 함수, 스마트 센서 연산자  | 
| ExecutedTasks | smart\_sensor\_operator.executed\_tasks | 개수 | 함수, 스마트 센서 연산자  | 
| InfraFailures | smart\_sensor\_operator.infra\_failures | 개수 | 함수, 스마트 센서 연산자  | 
| LoadedTasks | smart\_sensor\_operator.loaded\_tasks | 개수 | 함수, 스마트 센서 연산자  | 
| TotalParseTime | dag\_processing.total\_parse\_time | 초 | 함수, DAG 프로세싱  | 
| TriggeredDagRuns Apache Airflow v2.6.3 이상에서 사용 가능.  | dataset.triggered\_dagruns | 개수 | 함수, 스케줄러 | 
| TriggersRunning Apache Airflow v2.7.2 이상에서 사용 가능.  | triggers.running.{{{hostname}}} | 개수 | 함수, 트리거<br />호스트 이름, {{{hostname}}} | 
| PoolDeferredSlots Apache Airflow v2.7.2 이상에서 사용 가능.  | pool.deferred\_slots. `{pool_name}`  | 개수 | 풀, {pool\_name} | 
| DAGFileProcessingLastRunSecondsAgo | dag\_processing.last\_run.seconds\_ago.{dag\_filename} | 초 | DAG 파일 이름, {dag\_filename} | 
| OpenSlots | executor.open\_slots | 개수 | 함수, 실행기  | 
| OrphanedTasksAdopted | scheduler.orphaned\_tasks.adopted | 개수 | 함수, 스케줄러 | 
| OrphanedTasksCleared | scheduler.orphaned\_tasks.cleared | 개수 | 함수, 스케줄러 | 
| PokedExceptions | smart\_sensor\_operator.poked\_exception | 개수 | 함수, 스마트 센서 연산자  | 
| PokedSuccess | smart\_sensor\_operator.poked\_success | 개수 | 함수, 스마트 센서 연산자  | 
| PokedTasks | smart\_sensor\_operator.poked\_tasks | 개수 | 함수, 스마트 센서 연산자  | 
| PoolFailures | pool.open\_slots.{pool\_name} | 개수 | 풀, {pool\_name} | 
| PoolStarvingTasks | pool.starving\_tasks.{pool\_name} | 개수 | 풀, {pool\_name} | 
| PoolOpenSlots | pool.open\_slots.{pool\_name} | 개수 | 풀, {pool\_name} | 
| PoolQueuedSlots | pool.queued\_slots.{pool\_name} | 개수 | 풀, {pool\_name} | 
| PoolRunningSlots | pool.running\_slots.{pool\_name} | 개수 | 풀, {pool\_name} | 
| ProcessorTimeouts | dag\_processing.processor\_timeouts | 개수 | 함수, DAG 프로세싱  | 
| QueuedTasks | executor.queued\_tasks | 개수 | 함수, 실행기  | 
| RunningTasks | executor.running\_tasks | 개수 | 함수, 실행기  | 
| TasksExecutable | scheduler.tasks.executable | 개수 | 함수, 스케줄러 | 
| TasksPending Apache Airflow v2.2 이상에는 적용되지 않습니다.  | scheduler.tasks.pending | 개수 | 함수, 스케줄러 | 
| TasksRunning | scheduler.tasks.running | 개수 | 함수, 스케줄러 | 
| TasksStarving | scheduler.tasks.starving | 개수 | 함수, 스케줄러 | 
| TasksWithoutDagRun | scheduler.tasks.without\_dagrun | 개수 | 함수, 스케줄러 | 
| DAGFileProcessingLastNumOfDbQueries Apache Airflow v2.10.1 이상에서 사용 가능  | dag\_processing.last\_num\_of\_db\_queries.{dag\_filename} | 개수 | DAG 파일 이름, {dag\_filename} | 
| PoolScheduledSlots Apache Airflow v2.10.1 이상에서 사용 가능  | pool.scheduled\_slots.{pool\_name} | 개수 | 풀, {pool\_name} | 
| TaskCpuUsage Apache Airflow v2.10.1 이상에서 사용 가능  | cpu.usage.{dag\_id}.{task\_id} | % | DAG, {dag\_id}<br />작업, {task\_id} | 
| TaskMemoryUsage Apache Airflow v2.10.1 이상에서 사용 가능  | mem.usage.{dag\_id}.{task\_id} | % | DAG, {dag\_id}<br />작업, {task\_id} | 

### Apache Airflow 타이머
<a name="timers-metrics"></a>

[이 섹션의 Apache Airflow 지표에는 Apache Airflow *타이머*에 대한 데이터가 포함되어 있습니다.](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/metrics.html#timers)


| CloudWatch 지표 | Apache Airflow 지표 | 단위 | 측정 기준 | 
| --- | --- | --- | --- | 
| CollectDBDags | collect\_db\_dags | 밀리초 | 함수, DAG 프로세싱  | 
| CriticalSectionDuration | scheduler.critical\_section\_duration | 밀리초 | 함수, 스케줄러 | 
| CriticalSectionQueryDuration Apache Airflow v2.5.1 이상에서 사용 가능.  | scheduler.critical\_section\_query\_duration | 밀리초 | 함수, 스케줄러 | 
| DAGDependencyCheck | dagrun.dependency-check.{dag\_id} | 밀리초 | DAG, {dag\_id} | 
| DAGDurationFailed | dagrun.duration.failed.{dag\_id} | 밀리초 | DAG, {dag\_id} | 
| DAGDurationSuccess | dagrun.duration.success.{dag\_id} | 밀리초 | DAG, {dag\_id} | 
| DAGFileProcessingLastDuration | dag\_processing.last\_duration.{dag\_filename} | 초 | DAG 파일 이름, {dag\_filename} | 
| DAGScheduleDelay | dagrun.schedule\_delay.{dag\_id} | 밀리초 | DAG, {dag\_id} | 
| FirstTaskSchedulingDelay | dagrun.{dag\_id}.first\_task\_scheduling\_delay | 밀리초 | DAG, {dag\_id} | 
| SchedulerLoopDuration Apache Airflow v2.5.1 이상에서 사용 가능.  | scheduler.scheduler\_loop\_duration | 밀리초 | 함수, 스케줄러 | 
| TaskInstanceDuration | dag.{dag\_id}.{task\_id}.duration | 밀리초 | DAG, {dag\_id}<br />작업, {task\_id} | 
| TaskInstanceQueuedDuration | dag.`{dag_id}`.`{task_id}`.queued\_duration Apache Airflow v2.7.2 이상에서 사용 가능.  | 밀리초 | DAG, {dag\_id}<br />작업, {task\_id} | 
| TaskInstanceScheduledDuration Apache Airflow v2.7.2 이상에서 사용 가능.  | dag.`{dag_id}`.`{task_id}`.scheduled\_duration | 밀리초 | DAG, {dag\_id}<br />작업, {task\_id} | 

## 보고할 지표 선택
<a name="choosing-metrics"></a>

다음 [Amazon MWAA 구성 옵션](configuring-env-variables.md)을 사용하여 CloudWatch로 내보내거나 Apache Airflow에서 차단할 Apache Airflow 지표를 선택할 수 있습니다.
+ **`metrics.metrics_allow_list`** - 사용자 환경에서 CloudWatch로 내보낼 지표를 선택하는 데 사용할 수 있는, 쉼표로 구분된 접두사 목록입니다. Apache Airflow가 가용한 모든 지표를 전송하지 않고 대신 요소의 하위 집합을 선택하도록 하려면 이 옵션을 사용합니다. 예를 들어 `scheduler,executor,dagrun`입니다.
+ **`metrics.metrics_block_list`** - 목록의 요소로 시작하는 지표를 필터링하기 위한, 쉼표로 구분된 접두사 목록입니다. 예를 들어 `scheduler,executor,dagrun`입니다.

`metrics.metrics_allow_list` 및 `metrics.metrics_block_list`를 모두 구성하면 Apache Airflow는 `metrics.metrics_block_list`을 무시합니다. `metrics.metrics_block_list`만 구성하고 `metrics.metrics_allow_list`는 구성하지 않은 경우, Apache Airflow는 사용자가 `metrics.metrics_block_list`에서 지정한 요소를 필터링합니다.

**참고**  
`metrics.metrics_allow_list` 및 `metrics.metrics_block_list` 구성 옵션은 Apache Airflow v2.6.3 이상에만 적용됩니다. 이전 버전의 Apache Airflow에서는 대신 `metrics.statsd_allow_list` 및 `metrics.statsd_block_list`를 사용합니다.

## 다음 단계
<a name="mwaa-metrics202-next-up"></a>
+ [PublishMetrics](https://docs.aws.amazon.com/mwaa/latest/API/API_PublishMetrics.html)에서 환경 상태 지표를 게시하는 데 사용하는 Amazon MWAA API 작업에 대해 알아봅니다.