jason810496 opened a new pull request, #71925: URL: https://github.com/apache/airflow/pull/71925
## Why Every configured `DBDagBag` emitted cache counters under `api_server.dag_bag.*`. Once the scheduler gained a bounded cache in #71704, scheduler traffic was counted against the API server's series, so operators could not distinguish the two components. The cache settings and metrics also made every `DBDagBag` caller opt into an interface intended only for long-lived component caches. ## How `DBDagBag` remains the simple base implementation for callers that do not configure eviction or cache metrics. `CachedDBDagBag` owns LRU, TTL, and no-eviction cache modes, along with thread safety and the required component metric namespace. The API server always constructs `CachedDBDagBag` from its cache configuration. With size and TTL both set to 0, the subclass uses a plain unbounded dict and performs no eviction. The scheduler constructs `CachedDBDagBag` under `scheduler.dag_bag.*`. The metrics registry check now matches every static part of a dynamic metric name, including names assembled from a caller-supplied prefix. ## What - Reports API server cache metrics under `api_server.dag_bag.*`. - Reports scheduler cache metrics under `scheduler.dag_bag.*`. - Keeps short-lived and compatibility callers on the base `DBDagBag`. - Preserves the existing `0/0` no-eviction behavior while keeping configured component caches on `CachedDBDagBag`. cherry picked from commit bcf1dbf41a0593e44398c04b3d2aee7eeabe6ed5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
