Skip to content

Commit 5b2d41b

Browse files
committed
Set API server DAG bag stats prefix explicitly
1 parent 4029da4 commit 5b2d41b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • airflow-core/src/airflow/api_fastapi/common

airflow-core/src/airflow/api_fastapi/common/dagbag.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ def create_dag_bag() -> DBDagBag:
4747

4848
# Use unbounded dict (no eviction) if cache_size is 0
4949
if cache_size <= 0:
50-
return DBDagBag(cache_size=0)
50+
return DBDagBag(cache_size=0, stats_prefix="api_server.dag_bag")
5151

5252
# Disable TTL if cache_ttl is 0
5353
cache_ttl: int | None = cache_ttl_config if cache_ttl_config > 0 else None
5454

55-
return DBDagBag(cache_size=cache_size, cache_ttl=cache_ttl)
55+
return DBDagBag(
56+
cache_size=cache_size,
57+
cache_ttl=cache_ttl,
58+
stats_prefix="api_server.dag_bag",
59+
)
5660

5761

5862
def dag_bag_from_app(request: Request) -> DBDagBag:

0 commit comments

Comments
 (0)