Skip to content

Not all pool names align with stats naming restrictions #59935

@BasPH

Description

@BasPH

Apache Airflow version

Other Airflow 3 version (please specify below)

If "Other Airflow 3 version" selected, which one?

3.1.1

What happened?

Pool names can take any character, for example:
pool name with whitespace and emoji😎 is a valid pool name.

However, this will raise an InvalidStatsNameException when reporting metrics such as:

2025-12-30T10:47:28.000732Z [error    ] Invalid stat name: pool.deferred_slots.pool name with whitespace and emoji😎 table. [airflow.metrics.validators] loc=validators.py:125
airflow.exceptions.InvalidStatsNameException: The stat name (pool.running_slots.pool name with whitespace and emoji😎) has to be composed of ASCII alphabets, numbers, or the underscore, dot, or dash characters.

What you think should happen instead?

Valid pool names should report metrics too, and not cause an InvalidStatsNameException. Thinking out loud, we could:

  • Transform the name into a valid stat name
  • Report metrics using the pool id instead
  • Restrict pool names
  • ....?

All options are non-ideal because they're all (potential?) breaking changes, so open to alternative options.

How to reproduce

See above

Operating System

N/A

Versions of Apache Airflow Providers

No response

Deployment

Astronomer

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions