ersalil commented on code in PR #68284:
URL: https://github.com/apache/airflow/pull/68284#discussion_r3384618015
##########
shared/observability/src/airflow_shared/observability/metrics/otel_logger.py:
##########
@@ -299,7 +303,12 @@ def timer(
**kwargs,
) -> Timer:
"""Timer context manager returns the duration and can be cancelled."""
- return _OtelTimer(self, stat, tags)
+ safe_stat = (
+ stat
+ if stat is not None and self.metrics_validator.test(stat) and
name_is_otel_safe(self.prefix, stat)
Review Comment:
Thanks @kaxil , great suggestion! Done — pulled it into a _is_recordable()
helper and routed all six checks (incr, decr, gauge ×2, timing, timer) through
it so none can miss the guard. 🙏
Drafted-by: Claude Code (Opus 4.8); reviewed by @ersalil before posting
--
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]