ashb commented on issue #6157: [AIRFLOW-774] Fix long-broken DAG parsing Statsd 
metrics
URL: https://github.com/apache/airflow/pull/6157#issuecomment-533650837
 
 
   @feng-tao The same metric is emited in multiple places. If you look you will 
find both (one eith the filename and one without) Maybe statsd ignores that one 
(I was looking at the metrics emitted via running netcat).
   
   But to give it more detail. Take a dag_folder of /opt/airflow/dags and 
/opt/airflow/dags/dag1.py
   
   - When parsing a single DAG file, create a dag bag like this 
https://github.com/apache/airflow/blob/04da038100786da179f977df4eb2bab5352949d9/airflow/jobs/scheduler_job.py#L1502
 (for example `/opt/airflow/dags/dag1.py`)
   - So `dag_folder` is in fact the path to a single file, not the whole dag 
folder as we might expect from the name.
   - When it comes to do `filepath.replace(dag_folder, '')`:
       * `filepath` is `/opt/airflow/dags/dag1.py`
       * `dag_folder` is ALSO `/opt/airflow/dags/dag1.py`
       * so the end result is `''`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to