Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIP-49] Decouple metrics clients and validators into their own modules #30802

Merged
merged 3 commits into from
Apr 24, 2023

Conversation

ferruzzi
Copy link
Contributor

@ferruzzi ferruzzi commented Apr 21, 2023

Overview
Part of the ongoing OTel implementation. Should not contain any logic changes, just moving things around into a more modular "plugin" style layout like we have elsewhere instead of the "monolithic" stats.py we currently have.

@howardyoo and @potiuk: This is (my proposal for) the change we discussed yesterday.

Motivation
airflow/stats.py currently contains the metrics interface as well as implementations of the interface for StatsD and Datadog, some protocols, and validators (along with their interface). This PR does not change any logic, simply moves related content into relevant modules. For example All StatsD-specific code now lives in airflow/metrics/statsd-logger.py. This is to make the stats.py file a bit cleaner, make adding OTel easier, and possibly make removing the StatsD easier later if we choose to go that route.

When I add the OpenTelemetry code, it will live in airflow/metrics/otel-logger.pyand simply import and implement the interfaces from stats.py and metrics/protocols.py instead of adding it to the existing growing monolith in stats.py.

Testing
Passes breeze static-checks --all-files and breeze testing tests --run-in-parallel locally.

cc: @o-nikolas @vincbeck @vandonr-amz @syedahsn

@ferruzzi
Copy link
Contributor Author

ferruzzi commented Apr 21, 2023

Interesting. Looking into it.

image

Suggestions always welcome

@ferruzzi ferruzzi force-pushed the ferruzzi/otel/m3-decoupling branch from 0d1d3f2 to fbf5e93 Compare April 22, 2023 07:12
@potiuk
Copy link
Member

potiuk commented Apr 23, 2023

Needs conflict resolving

@ferruzzi ferruzzi force-pushed the ferruzzi/otel/m3-decoupling branch from fbf5e93 to 6f40108 Compare April 24, 2023 16:54
@o-nikolas
Copy link
Contributor

lgtm, I like the refactor, very useful to break down these massive modules a bit. I've been doing similar stuff in the CLI space.

@potiuk
Copy link
Member

potiuk commented Apr 24, 2023

Agree.

@potiuk potiuk merged commit 7411370 into apache:main Apr 24, 2023
@ephraimbuddy ephraimbuddy added this to the Airflow 2.7.0 milestone May 8, 2023
@ephraimbuddy ephraimbuddy added the type:improvement Changelog: Improvements label May 8, 2023
@ferruzzi ferruzzi changed the title Decouple metrics clients and validators into their own modules [AIP-49] Decouple metrics clients and validators into their own modules Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants