Skip to content

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

Merged
potiuk merged 3 commits into
apache:mainfrom
aws-mwaa:ferruzzi/otel/m3-decoupling
Apr 24, 2023
Merged

[AIP-49] Decouple metrics clients and validators into their own modules#30802
potiuk merged 3 commits into
apache:mainfrom
aws-mwaa:ferruzzi/otel/m3-decoupling

Conversation

@ferruzzi

@ferruzzi ferruzzi commented Apr 21, 2023

Copy link
Copy Markdown
Contributor

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

ferruzzi commented Apr 21, 2023

Copy link
Copy Markdown
Contributor Author

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

potiuk commented Apr 23, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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

potiuk commented Apr 24, 2023

Copy link
Copy Markdown
Member

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