fiodarsazanavets opened a new issue #9854:
URL: https://github.com/apache/airflow/issues/9854


   
   
   **Apache Airflow version**:
   1.10.9
   
   **Environment**:
   Docker Swarm
   
   **What happened**:
   We are running Airflow in a separate Docker container where we have StatsD 
metrics enabled. The StatsD server is running in a separate container on the 
same network and Airflow is configured to send metrics to it.
   
   If, for whatever reason, the StatsD server container is not available, 
absolutely any Airflow action that outputs metrics will fail. You won't even be 
able to execute basic commands, such as "airflow version".
   
   The example error message is as follows:
   
   ```
   File "/usr/local/bin/airflow", line 25, in <module>
       from airflow.configuration import conf
     File "/usr/local/lib/python3.7/site-packages/airflow/__init__.py", line 
31, in <module>
       from airflow.utils.log.logging_mixin import LoggingMixin
     File "/usr/local/lib/python3.7/site-packages/airflow/utils/__init__.py", 
line 24, in <module>
       from .decorators import apply_defaults as _apply_defaults
     File "/usr/local/lib/python3.7/site-packages/airflow/utils/decorators.py", 
line 34, in <module>
       from airflow import settings
     File "/usr/local/lib/python3.7/site-packages/airflow/settings.py", line 
121, in <module>
       prefix=conf.get('scheduler', 'statsd_prefix'))
     File 
"/usr/local/airflow/.local/lib/python3.7/site-packages/statsd/client/udp.py", 
line 35, in __init__
       host, port, fam, socket.SOCK_DGRAM)[0]
     File "/usr/local/lib/python3.7/socket.py", line 748, in getaddrinfo
       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
   socket.gaierror: [Errno -2] Name or service not known
   ```
   
   **What you expected to happen**:
   This error shouldn't occur, as the metrics are sent via UDP in a 
fire-and-forget fashion. Perhaps, it would make sense to log an error if the 
metrics endpoint doesn't exist, but it doesn't make sense to prevent the action 
from executing.
   
   
   **How to reproduce it**:
   1. Build and run a Docker container with any type of StatsD receiver (e.g. 
[Prometheus StatsD Exporter](https://github.com/prometheus/statsd_exporter)).
   2. Build and run Airflow Docker container with StatsD requirement installer 
that is configured to send metrics to the StatsD receiver container (as per 
[this instruction](https://airflow.apache.org/docs/stable/metrics.html)).
   3. Stop the StatsD receiver container.
   4. Enter bash on the Airflow container and execute "airflow version" command.
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to