Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing pool metrics to UME #952

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add missing pool metrics to UME #952

wants to merge 2 commits into from

Conversation

m1racoli
Copy link

@m1racoli m1racoli commented Mar 5, 2025

Details

Add the following Airflow metrics:

  • pool.deferred_slots -> airflow_pool_deferred_slots
  • pool.scheduled_slots -> airflow_pool_scheduled_slots

Related Issues

Related to https://github.com/astronomer/astro/issues/28040

Checklist

  • version.txt was updated

Testing

docker-compose.override.yml

services:
  prometheus:
    image: prom/prometheus
    restart: always
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"
    command:
      - --web.enable-admin-api
      - --web.enable-lifecycle
      # Flags below are defaults, but must be added explicitly, otherwise would be overridden by flags above
      - --config.file=/etc/prometheus/prometheus.yml
      - --storage.tsdb.path=/prometheus
      - --web.console.libraries=/usr/share/prometheus/console_libraries
      - --web.console.templates=/usr/share/prometheus/consoles
    networks:
      - airflow

  statsd_exporter:
    image: prom/statsd-exporter
    restart: always
    volumes:
      - ./statsd_mapping.yml:/tmp/statsd_mapping.yml
    ports:
      - "9102:9102"
      - "9125:9125/udp"
    command: --statsd.mapping-config=/tmp/statsd_mapping.yml
    networks:
      - airflow

Dockerfile

FROM quay.io/astronomer/astro-runtime:12.7.1
ENV AIRFLOW__METRICS__STATSD_ON=True
ENV AIRFLOW__METRICS__STATSD_HOST=statsd_exporter
ENV AIRFLOW__METRICS__STATSD_PORT=9125

prometheus.yml

global:
  scrape_interval: 15s
  scrape_timeout: 10s
  evaluation_interval: 15s

scrape_configs:
  - job_name: statsd-exporter
    static_configs:
      - targets:
          - statsd_exporter:9102

And the statsd_mapping.yml from this PR.

Output from http://localhost:9102/metrics:

...
# HELP airflow_pool_deferred_slots Metric autogenerated by statsd_exporter.
# TYPE airflow_pool_deferred_slots gauge
airflow_pool_deferred_slots{pool="default_pool"} 0
# HELP airflow_pool_open_slots Metric autogenerated by statsd_exporter.
# TYPE airflow_pool_open_slots gauge
airflow_pool_open_slots{pool="default_pool"} 128
# HELP airflow_pool_queued_slots Metric autogenerated by statsd_exporter.
# TYPE airflow_pool_queued_slots gauge
airflow_pool_queued_slots{pool="default_pool"} 0
# HELP airflow_pool_running_slots Metric autogenerated by statsd_exporter.
# TYPE airflow_pool_running_slots gauge
airflow_pool_running_slots{pool="default_pool"} 0
# HELP airflow_pool_scheduled_slots Metric autogenerated by statsd_exporter.
# TYPE airflow_pool_scheduled_slots gauge
airflow_pool_scheduled_slots{pool="default_pool"} 0
...

@m1racoli m1racoli requested review from a team as code owners March 5, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants