Hi Dennis,

Thanks for writing up AIP-114. I am supportive of the direction. The
"generic backends in core, vendor-specific backends in providers" split is
easy to explain to users, and the fix-delivery model (protocol bugs in core,
backend bugs where the backend lives) is the same one we already have for
executors - which I think answers Elad's concern well. This is different
from SMTP, where the same feature lives in two places.

However, when I looked at how metrics are wired today, the AIP describes
this as a change in providers_manager.py only, and I think it misses a few
places that need to be covered explicitly. Possibly it's because the AIP
and discussion is pretty "old":

1. Task SDK / workers. There are two stats factories:
   airflow-core/src/airflow/observability/metrics/stats_utils.py (scheduler,
   Dag processor, API server) and
   task-sdk/src/airflow/sdk/observability/metrics/stats_utils.py (used by
   the task runner). Workers do not use the core ProvidersManager - they use
   ProvidersManagerTaskRuntime in the Task SDK. If only core is changed,
   scheduler and API server metrics go to CloudWatch, while task metrics
   silently fall back to the boolean flags. The AIP should cover both
   factories; _discover_remote_logging in providers_manager_runtime.py is a
   good precedent for runtime-side discovery.

2. "Are metrics enabled" checks. Both stats_utils.is_metrics_enabled() in
   core and SchedulerJobRunner._is_metrics_enabled() only look at
   statsd_on / otel_on / statsd_datadog_enabled. With only
   [metrics] backend set, the scheduler would skip the metrics these checks
   gate, and the API server would skip its HTTP metrics. I'd add a done
   criterion like "every component emits through the configured backend",
   not only "existing behaviour unchanged when backend is unset".

3. Discovery vs. loading. Since [metrics] backend is an import path (like
   [secrets] backend, or the existing [metrics] statsd_custom_client_path,
   which is worth mentioning in the AIP as prior art), loading does not
   need provider.yaml discovery at all. The metrics-backends key is then
   for listing, docs generation and validation - exactly what the
   secrets-backends key does today. That's fine, but stating it makes clear
   how small the core change really is.

4. Interface and failure mode. Please specify which protocol a backend must
   implement (the StatsLogger protocol in shared/observability?), the
   constructor contract (the current factories take no arguments and each
   backend reads its own config), and what happens when backend points to a
   provider that is missing or too old: fail at startup, or warn and fall
   back to no metrics.

5. Credentials in all components. A CloudWatch backend talking to AWS needs
   credentials in the scheduler, Dag processor, triggerer and every worker,
   at a point where workers cannot yet retrieve Airflow connections. It
   would be good to state how backends are expected to get credentials
   (I assume the ambient AWS credential chain).

6. Tracing. OTel covers both metrics and traces - please state explicitly
   that the AIP is about metrics only and tracing backends are out of
   scope.

1 and 2 are the important ones - without them the feature would half-work
in a way that is hard for users to diagnose. With those covered, I'd be
happy to see it go to a vote.

J.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to