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.

Metrics - Introducing a counter for number of DAGs in "running" state

See original GitHub issue

Description

Could we introduce a new counter in Airflow Metrics to track number of DAGs that are in ‘running’ state?

I am aware of the existing dag_processing.processes counter that is documented as Number of currently running DAG parsing processes. This counter track how many dags are being parsed, not how many are runnings.

I am aware of the existing executor.queued_tasks and executor.running_tasks, but they are task-wise and not dag-wise.

Use case / motivation

Consider this example Screenshot 2020-11-14 at 16 42 40

I want to know how many DAGs are in the state of running to understand memory consumption issues and to understand how long is my “queue” of DAGs. To my understanding there is no metric currently that I can use to track that.

I propose a counter executor.running_dags that would return the number of DAGs in the running state.

Does this make sense? Am I missing something? If folks I agree I would be happy to work on a PR 😃

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SolbiatiAlessandrocommented, Nov 14, 2020

@mik-laj thanks for the repsonse! I will look into that 😃 Do you think we should add two lines in this doc page to mention that statsd only track non-database information and you can find more metrics in the database? https://airflow.apache.org/docs/stable/metrics.html

1reaction
mik-lajcommented, Nov 14, 2020

This information is in the database so you can use: https://github.com/robinhood/airflow-prometheus-exporter or https://github.com/PBWebMedia/airflow-prometheus-exporter or other similar exporter

We use statsd metrics only for information that we do not have in the database, i.e. runtime metrics.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Metrics for Airflow Monitoring and Best Practices - Hevo Data
You can see how the DAG's tasks are organized and the status of each connected run. This allows you to track the state...
Read more >
Metrics — Airflow Documentation - Apache Airflow
Gauges. Number of tasks that are ready for execution (set to queued) with respect to pool limits, dag concurrency, executor state, and priority....
Read more >
Prometheus Counters and how to deal with them - INNOQ
A single metric means, that a Counter represents a single value, e.g. the number of orders created in a shop system. It's monotonically ......
Read more >
Creating and Reporting on Time Based Metrics - iCIMS
Time from Apply to Hire: The number of days to hire a candidate for a job after they apply to that job. By...
Read more >
Top 10 cAdvisor Metrics for Prometheus | MetricFire Blog
Introduction to cAdvisor; cAdvisor metrics overview ... metric tracks the number of tasks or processes in a given state (sleeping, running, ...
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