Skip to content

Commit 3a0d433

Browse files
committed
ch.06 예제 추가
1 parent 6557907 commit 3a0d433

File tree

13 files changed

+3027
-7
lines changed

13 files changed

+3027
-7
lines changed
Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
mappings:
2+
# Airflow StatsD metrics mappings (https://airflow.apache.org/docs/apache-airflow/stable/logging-monitoring/metrics.html)
3+
# === Counters ===
4+
- match: "(.+)\\.(.+)_start$"
5+
match_metric_type: counter
6+
name: "af_agg_job_start"
7+
match_type: regex
8+
labels:
9+
airflow_id: "$1"
10+
job_name: "$2"
11+
- match: "(.+)\\.(.+)_end$"
12+
match_metric_type: counter
13+
name: "af_agg_job_end"
14+
match_type: regex
15+
labels:
16+
airflow_id: "$1"
17+
job_name: "$2"
18+
- match: "(.+)\\.operator_failures_(.+)$"
19+
match_metric_type: counter
20+
name: "af_agg_operator_failures"
21+
match_type: regex
22+
labels:
23+
airflow_id: "$1"
24+
operator_name: "$2"
25+
- match: "(.+)\\.operator_successes_(.+)$"
26+
match_metric_type: counter
27+
name: "af_agg_operator_successes"
28+
match_type: regex
29+
labels:
30+
airflow_id: "$1"
31+
operator_name: "$2"
32+
- match: "*.ti_failures"
33+
match_metric_type: counter
34+
name: "af_agg_ti_failures"
35+
labels:
36+
airflow_id: "$1"
37+
- match: "*.ti_successes"
38+
match_metric_type: counter
39+
name: "af_agg_ti_successes"
40+
labels:
41+
airflow_id: "$1"
42+
- match: "*.zombies_killed"
43+
match_metric_type: counter
44+
name: "af_agg_zombies_killed"
45+
labels:
46+
airflow_id: "$1"
47+
- match: "*.scheduler_heartbeat"
48+
match_metric_type: counter
49+
name: "af_agg_scheduler_heartbeat"
50+
labels:
51+
airflow_id: "$1"
52+
- match: "*.dag_processing.processes"
53+
match_metric_type: counter
54+
name: "af_agg_dag_processing_processes"
55+
labels:
56+
airflow_id: "$1"
57+
- match: "*.scheduler.tasks.killed_externally"
58+
match_metric_type: counter
59+
name: "af_agg_scheduler_tasks_killed_externally"
60+
labels:
61+
airflow_id: "$1"
62+
- match: "*.scheduler.tasks.running"
63+
match_metric_type: counter
64+
name: "af_agg_scheduler_tasks_running"
65+
labels:
66+
airflow_id: "$1"
67+
- match: "*.scheduler.tasks.starving"
68+
match_metric_type: counter
69+
name: "af_agg_scheduler_tasks_starving"
70+
labels:
71+
airflow_id: "$1"
72+
- match: "*.scheduler.orphaned_tasks.cleared"
73+
match_metric_type: counter
74+
name: "af_agg_scheduler_orphaned_tasks_cleared"
75+
labels:
76+
airflow_id: "$1"
77+
- match: "*.scheduler.orphaned_tasks.adopted"
78+
match_metric_type: counter
79+
name: "af_agg_scheduler_orphaned_tasks_adopted"
80+
labels:
81+
airflow_id: "$1"
82+
- match: "*.scheduler.critical_section_busy"
83+
match_metric_type: counter
84+
name: "af_agg_scheduler_critical_section_busy"
85+
labels:
86+
airflow_id: "$1"
87+
- match: "*.sla_email_notification_failure"
88+
match_metric_type: counter
89+
name: "af_agg_sla_email_notification_failure"
90+
labels:
91+
airflow_id: "$1"
92+
- match: "*.ti.start.*.*"
93+
match_metric_type: counter
94+
name: "af_agg_ti_start"
95+
labels:
96+
airflow_id: "$1"
97+
dag_id: "$2"
98+
task_id: "$3"
99+
- match: "*.ti.finish.*.*.*"
100+
match_metric_type: counter
101+
name: "af_agg_ti_finish"
102+
labels:
103+
airflow_id: "$1"
104+
dag_id: "$2"
105+
task_id: "$3"
106+
state: "$4"
107+
- match: "*.dag.callback_exceptions"
108+
match_metric_type: counter
109+
name: "af_agg_dag_callback_exceptions"
110+
labels:
111+
airflow_id: "$1"
112+
- match: "*.celery.task_timeout_error"
113+
match_metric_type: counter
114+
name: "af_agg_celery_task_timeout_error"
115+
labels:
116+
airflow_id: "$1"
117+
118+
# === Gauges ===
119+
- match: "*.dagbag_size"
120+
match_metric_type: gauge
121+
name: "af_agg_dagbag_size"
122+
labels:
123+
airflow_id: "$1"
124+
- match: "*.dag_processing.import_errors"
125+
match_metric_type: gauge
126+
name: "af_agg_dag_processing_import_errors"
127+
labels:
128+
airflow_id: "$1"
129+
- match: "*.dag_processing.total_parse_time"
130+
match_metric_type: gauge
131+
name: "af_agg_dag_processing_total_parse_time"
132+
labels:
133+
airflow_id: "$1"
134+
- match: "*.dag_processing.last_runtime.*"
135+
match_metric_type: gauge
136+
name: "af_agg_dag_processing_last_runtime"
137+
labels:
138+
airflow_id: "$1"
139+
dag_file: "$2"
140+
- match: "*.dag_processing.last_run.seconds_ago.*"
141+
match_metric_type: gauge
142+
name: "af_agg_dag_processing_last_run_seconds"
143+
labels:
144+
airflow_id: "$1"
145+
dag_file: "$2"
146+
- match: "*.dag_processing.processor_timeouts"
147+
match_metric_type: gauge
148+
name: "af_agg_dag_processing_processor_timeouts"
149+
labels:
150+
airflow_id: "$1"
151+
- match: "*.executor.open_slots"
152+
match_metric_type: gauge
153+
name: "af_agg_executor_open_slots"
154+
labels:
155+
airflow_id: "$1"
156+
- match: "*.executor.queued_tasks"
157+
match_metric_type: gauge
158+
name: "af_agg_executor_queued_tasks"
159+
labels:
160+
airflow_id: "$1"
161+
- match: "*.executor.running_tasks"
162+
match_metric_type: gauge
163+
name: "af_agg_executor_running_tasks"
164+
labels:
165+
airflow_id: "$1"
166+
- match: "*.pool.open_slots.*"
167+
match_metric_type: gauge
168+
name: "af_agg_pool_open_slots"
169+
labels:
170+
airflow_id: "$1"
171+
pool_name: "$2"
172+
- match: "*.pool.queued_slots.*"
173+
match_metric_type: gauge
174+
name: "af_agg_pool_queued_slots"
175+
labels:
176+
airflow_id: "$1"
177+
pool_name: "$2"
178+
- match: "*.pool.running_slots.*"
179+
match_metric_type: gauge
180+
name: "af_agg_pool_running_slots"
181+
labels:
182+
airflow_id: "$1"
183+
pool_name: "$2"
184+
- match: "*.pool.starving_tasks.*"
185+
match_metric_type: gauge
186+
name: "af_agg_pool_starving_tasks"
187+
labels:
188+
airflow_id: "$1"
189+
pool_name: "$2"
190+
- match: "*.smart_sensor_operator.poked_tasks"
191+
match_metric_type: gauge
192+
name: "af_agg_smart_sensor_operator_poked_tasks"
193+
labels:
194+
airflow_id: "$1"
195+
- match: "*.smart_sensor_operator.poked_success"
196+
match_metric_type: gauge
197+
name: "af_agg_smart_sensor_operator_poked_success"
198+
labels:
199+
airflow_id: "$1"
200+
- match: "*.smart_sensor_operator.poked_exception"
201+
match_metric_type: gauge
202+
name: "af_agg_smart_sensor_operator_poked_exception"
203+
labels:
204+
airflow_id: "$1"
205+
- match: "*.smart_sensor_operator.exception_failures"
206+
match_metric_type: gauge
207+
name: "af_agg_smart_sensor_operator_exception_failures"
208+
labels:
209+
airflow_id: "$1"
210+
- match: "*.smart_sensor_operator.infra_failures"
211+
match_metric_type: gauge
212+
name: "af_agg_smart_sensor_operator_infra_failures"
213+
labels:
214+
airflow_id: "$1"
215+
216+
# === Timers ===
217+
- match: "*.dagrun.dependency-check.*"
218+
match_metric_type: observer
219+
name: "af_agg_dagrun_dependency_check"
220+
labels:
221+
airflow_id: "$1"
222+
dag_id: "$2"
223+
- match: "*.dag.*.*.duration"
224+
match_metric_type: observer
225+
name: "af_agg_dag_task_duration"
226+
labels:
227+
airflow_id: "$1"
228+
dag_id: "$2"
229+
task_id: "$3"
230+
- match: "*.dag_processing.last_duration.*"
231+
match_metric_type: observer
232+
name: "af_agg_dag_processing_duration"
233+
labels:
234+
airflow_id: "$1"
235+
dag_file: "$2"
236+
- match: "*.dagrun.duration.success.*"
237+
match_metric_type: observer
238+
name: "af_agg_dagrun_duration_success"
239+
labels:
240+
airflow_id: "$1"
241+
dag_id: "$2"
242+
- match: "*.dagrun.duration.failed.*"
243+
match_metric_type: observer
244+
name: "af_agg_dagrun_duration_failed"
245+
labels:
246+
airflow_id: "$1"
247+
dag_id: "$2"
248+
- match: "*.dagrun.schedule_delay.*"
249+
match_metric_type: observer
250+
name: "af_agg_dagrun_schedule_delay"
251+
labels:
252+
airflow_id: "$1"
253+
dag_id: "$2"
254+
- match: "*.scheduler.critical_section_duration"
255+
match_metric_type: observer
256+
name: "af_agg_scheduler_critical_section_duration"
257+
labels:
258+
airflow_id: "$1"
259+
- match: "*.dagrun.*.first_task_scheduling_delay"
260+
match_metric_type: observer
261+
name: "af_agg_dagrun_first_task_scheduling_delay"
262+
labels:
263+
airflow_id: "$1"
264+
dag_id: "$2"

0 commit comments

Comments
 (0)