You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "stuart23 (via GitHub)" <gi...@apache.org> on 2024/02/16 14:09:25 UTC

[PR] Update statsd-mappings.yml [airflow]

stuart23 opened a new pull request, #37480:
URL: https://github.com/apache/airflow/pull/37480

   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   
   For tasks that belong to task groups, the emitted metric format is `airflow.dag.<dag_id>.<taskgroup_id>.<task_id>.duration` and therefore it is not being picked up by the existing airflow_task_duration mapping. This adds an extra mapping to capture those use metrics and parse them.
   
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on code in PR #37480:
URL: https://github.com/apache/airflow/pull/37480#discussion_r1496950583


##########
chart/files/statsd-mappings.yml:
##########
@@ -52,6 +52,13 @@ mappings:
       dag_id: "$1"
       task_id: "$2"
 
+  - match: airflow.dag.*.*.*.duration

Review Comment:
   Another curve ball, guess what? Dags can have dots too :) So imagine we have `airflow.dag.first.second.third`. This could be:
   
   - dag_id=first, task_group=second, task_id=third
   - dag_id=first.second, task_id=third (no task_group at all)
   - dag_id=first, task_id=second.third (no task_group at all)
   
   You can also disable the task group id prefixing with `prefix_group_id=False`, so those last 2 could actually be in a task group, but not one named `second`.
   
   Basically, there isn't a reliable way to extract task group id out.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on PR #37480:
URL: https://github.com/apache/airflow/pull/37480#issuecomment-1948601359

   https://github.com/apache/airflow/blob/35c1a1a024e652c001930bf42416e06d3c20cf95/chart/files/statsd-mappings.yml#L18-L23


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "stuart23 (via GitHub)" <gi...@apache.org>.
stuart23 commented on PR #37480:
URL: https://github.com/apache/airflow/pull/37480#issuecomment-1955445221

   OK I guess I was just looking at our implementation that drops all non-matching metrics. Seems like there isn't going to be a good solution to unpack taskgroup tasks. I really hope we move to OTLP as soon as possible...


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "stuart23 (via GitHub)" <gi...@apache.org>.
stuart23 commented on code in PR #37480:
URL: https://github.com/apache/airflow/pull/37480#discussion_r1496701748


##########
chart/files/statsd-mappings.yml:
##########
@@ -52,6 +52,13 @@ mappings:
       dag_id: "$1"
       task_id: "$2"
 
+  - match: airflow.dag.*.*.*.duration

Review Comment:
   So the 2 dots will not be able to glob those tasks either then?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "stuart23 (via GitHub)" <gi...@apache.org>.
stuart23 commented on PR #37480:
URL: https://github.com/apache/airflow/pull/37480#issuecomment-1948807283

   > https://github.com/apache/airflow/blob/35c1a1a024e652c001930bf42416e06d3c20cf95/chart/files/statsd-mappings.yml#L18-L23
   
   This is fully backwards compatible, it will ship more metrics than already exist and won't change any existing metrics


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on code in PR #37480:
URL: https://github.com/apache/airflow/pull/37480#discussion_r1492994507


##########
chart/files/statsd-mappings.yml:
##########
@@ -52,6 +52,13 @@ mappings:
       dag_id: "$1"
       task_id: "$2"
 
+  - match: airflow.dag.*.*.*.duration

Review Comment:
   You can use dots in normal task_ids too. This doesn't mean the task is in a task group.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham closed pull request #37480: Update statsd-mappings.yml
URL: https://github.com/apache/airflow/pull/37480


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #37480:
URL: https://github.com/apache/airflow/pull/37480#issuecomment-1948452203

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update statsd-mappings.yml [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on PR #37480:
URL: https://github.com/apache/airflow/pull/37480#issuecomment-1949358805

   > This is fully backwards compatible, it will ship more metrics than already exist and won't change any existing metrics
   
   The chart just remaps, it doesn't exclude metrics that aren't covered. Task durations for tasks in task groups already are exposed. This would move them.
   
   e.g.
   
   ```
   airflow_dag_task_group_example_my_taskgroup_sometask_duration{quantile="0.5"} 0.17767495400000002
   airflow_dag_task_group_example_my_taskgroup_sometask_duration{quantile="0.9"} 0.17767495400000002
   airflow_dag_task_group_example_my_taskgroup_sometask_duration{quantile="0.99"} 0.17767495400000002
   airflow_dag_task_group_example_my_taskgroup_sometask_duration_sum 0.17767495400000002
   airflow_dag_task_group_example_my_taskgroup_sometask_duration_count 1
   ```
   
   Would become:
   
   ```
   airflow_task_duration{dag_id="task_group_example",task_id="sometask",taskgroup_id="my_taskgroup",quantile="0.5"} 0.085300168
   airflow_task_duration{dag_id="task_group_example",task_id="sometask",taskgroup_id="my_taskgroup",quantile="0.9"} 0.085300168
   airflow_task_duration{dag_id="task_group_example",task_id="sometask",taskgroup_id="my_taskgroup",quantile="0.99"} 0.085300168
   airflow_task_duration_sum{dag_id="task_group_example",task_id="sometask",taskgroup_id="my_taskgroup"} 0.085300168
   airflow_task_duration_count{dag_id="task_group_example",task_id="sometask",taskgroup_id="my_taskgroup"} 1
   ```


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org