question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Airflow 2.0 does not send metrics to statsD when Scheduler is run with Daemon mode

See original GitHub issue

Apache Airflow version: 2.0.0

Environment:

  • OS (e.g. from /etc/os-release): Ubuntu 20.04 LTS
  • Python version: 3.8
  • Kernel (e.g. uname -a): x86_64 x86_64 x86_64 GNU/Linux 5.4.0-58-generic #64-Ubuntu
  • Install tools: pip

What happened:

Airflow 2.0 does not send metrics to statsD.

I configure Airflow with official documentation (https://airflow.apache.org/docs/apache-airflow/stable/logging-monitoring/metrics.html) and by this article https://dstan.medium.com/run-airflow-statsd-grafana-locally-16b372c86524 (but I used port 8125).

I turned on statsD:

statsd_on = True
statsd_host = localhost
statsd_port = 8125
statsd_prefix = airflow

But I do not see airflow metrics at http://localhost:9102/metrics (statsD metrics endpoint).


P.S. I noticed this error just using Airflow 2.0. In version 1.10.13 everything is ok in the same environment.

Thank you for advance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ankxyzcommented, Jan 22, 2021

@potiuk Of course. Moreover, I generated airflow.cfg from scratch to test it.

Сlarification (recently noticed): the problem arises just if I run airflow scheduler in daemon mode:

airflow scheduler -D

If I start it normally (without param -D) or using nohup - everything ok:

nohup airflow scheduler >> ${AIRFLOW_HOMW}/logs/scheduler.log 2>&1 &

So I have the problem just with daemon mode.

0reactions
ashbcommented, Feb 26, 2021

Oh yes, daemon mode will close all open files and sockets.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GitHub] [airflow] ankxyz commented on issue #13741: Airflow 2.0 ...
... commented on issue #13741: Airflow 2.0 does not send metrics to statsD ... the problem arises just if I run `airflow scheduler`...
Read more >
Configuration Reference — Airflow ... - Apache Airflow
Configuration Reference¶. This page contains the list of all the available Airflow configurations that you can set in airflow.cfg file or using environment ......
Read more >
Metrics — Airflow Documentation - Apache Airflow
Airflow can be set up to send metrics to StatsD. Setup¶. First you must install StatsD requirement: pip install 'apache-airflow[statsd]'.
Read more >
Configuration Reference — Airflow ... - Apache Airflow
New in version 1.10.6. If you want to avoid sending all the available metrics to StatsD, you can configure an allow list of...
Read more >
Metrics — Airflow Documentation
Airflow can be set up to send metrics to StatsD. ... prefixes to send only the metrics that start with the elements of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found