Move the traces and metrics code under a common observability package#56187
Move the traces and metrics code under a common observability package#56187amoghrajesh merged 66 commits intoapache:mainfrom
Conversation
jason810496
left a comment
There was a problem hiding this comment.
Nice! Thanks for the cleanup!
LGTM for the Airflow-Core and Providers change, but I'm not sure about TaskSDK part.
I will leave it to someone more familiar to answer.
ferruzzi
left a comment
There was a problem hiding this comment.
Approved pending Ash weighing in on the SDK part.
|
@jason810496 @ferruzzi Thank you for the review! |
2ae0132 to
bf6b976
Compare
|
@jason810496 @ferruzzi @ashb It's ready for review. The CI is green. The step for running the task sdk integration tests seems to be flaky. https://github.com/apache/airflow/actions/runs/18505099702/job/52734949908?pr=56187 I ran it locally and it worked, so I triggered the CI again and it passed. To help you understand the changes faster
|
jason810496
left a comment
There was a problem hiding this comment.
Thanks for the update! The overall change LGMT, but there are still question about the dependencies for Airflow-Core and TaskSDK.
|
@xBis7 the failure on your PR: is unrelated and is due to a fastAPI bump it seems. |
b317f91 to
cd0a464
Compare
@amoghrajesh I see, it's on main as well. |
|
The fix is merged, rebasing it. |
@amoghrajesh I was about to do it. Thanks. |
|
@amoghrajesh @potiuk Both failures seem random. I ran the redis step locally and it worked. |
|
Just rebased again, hopefully its green and ready to merge! |
|
@amoghrajesh @potiuk Thank you for all the help! @jason810496 @ferruzzi @jscheffl Thank you for the reviews! |
|
Wooohooo |
|
#protm |
…apache#56187) - Create shared/observability with base metrics and traces implementations - Add task-sdk observability module with own Stats and Trace wrappers - task SDK no longer imports from airflow-core observability - Each component reads its own configuration - Export only Trace in public API (Stats is internal) --------- Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
|
Well done, and thanks for sticking with it. That was a long trek, but it turned out great. |
|
@ferruzzi Thank you! |
…apache#56187) - Create shared/observability with base metrics and traces implementations - Add task-sdk observability module with own Stats and Trace wrappers - task SDK no longer imports from airflow-core observability - Each component reads its own configuration - Export only Trace in public API (Stats is internal) --------- Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
…apache#56187) - Create shared/observability with base metrics and traces implementations - Add task-sdk observability module with own Stats and Trace wrappers - task SDK no longer imports from airflow-core observability - Each component reads its own configuration - Export only Trace in public API (Stats is internal) --------- Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
|
Do we not need to maintain the airflow.traces package due to backcompat? |
The removals in this PR were actually never in an Airflow release. This code was added or moved to the current location in PR #56187. Prior to that PR, the code was imported from the airflow.traces package. All of this code is made unnecessary by #62554 and some PRs that preceded it. The important question for this PR is, do we need to keep these interfaces around for backward compatibility purposes. But I think we don't. I think we can just remove it. And the reason why, is none of these interfaces appeared in the documentation. Additionally, no one identified backcompat as an issue in #56187, the PR that moved them to their present location (and did not maintain a backcompat layer); I think this also is indicative of the conclusion that people don't think of this as user-facing. So my best guess is, these interfaces weren't really intended to be used by users. Additionally, I think the likelihood that users actually used these classes is quite low. So I think the best course of action is to just remove them.
The removals in this PR were actually never in an Airflow release. This code was added or moved to the current location in PR apache#56187. Prior to that PR, the code was imported from the airflow.traces package. All of this code is made unnecessary by apache#62554 and some PRs that preceded it. The important question for this PR is, do we need to keep these interfaces around for backward compatibility purposes. But I think we don't. I think we can just remove it. And the reason why, is none of these interfaces appeared in the documentation. Additionally, no one identified backcompat as an issue in apache#56187, the PR that moved them to their present location (and did not maintain a backcompat layer); I think this also is indicative of the conclusion that people don't think of this as user-facing. So my best guess is, these interfaces weren't really intended to be used by users. Additionally, I think the likelihood that users actually used these classes is quite low. So I think the best course of action is to just remove them.
This patch is refactoring the
metricsand thetracespackages and moves them under a common package namedobservability.This is done so that it will be easier to add common files in the future.
The need for these changes came from this discussion
#56150 (comment)
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.