uranusjr commented on code in PR #70517:
URL: https://github.com/apache/airflow/pull/70517#discussion_r3800202646
##########
shared/observability/src/airflow_shared/observability/metrics/statsd_logger.py:
##########
@@ -171,12 +173,31 @@ def get_statsd_logger(
statsd_influxdb_enabled: bool = False,
) -> SafeStatsdLogger:
"""Return logger for StatsD."""
- statsd = stats_class(
- host=host,
- port=port,
- prefix=prefix,
- ipv6=ipv6,
- )
+ if socket_path is not None:
+ if stats_class is None:
+ stats_class = UnixSocketStatsClient
+ elif isinstance(stats_class, type) and not issubclass(stats_class,
UnixSocketStatsClient):
+ raise ValueError(
Review Comment:
You don’t need to really “depend” on anything since all shared libs are,
well, shared across Airflow components, and `configuration` is already
available everywhere `observability`. All you need to do is to import like this
```python
from ...configuration import AirflowConfigException
```
There are existing cases using this pattern in other shared libs.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]