xBis7 commented on code in PR #69371:
URL: https://github.com/apache/airflow/pull/69371#discussion_r3552213214
##########
airflow-core/docs/administration-and-deployment/logging-monitoring/metrics.rst:
##########
@@ -181,6 +183,73 @@ to the stat name if necessary, and returns the transformed
stat name. The functi
return stat_name.lower()[:32]
+Custom Metrics
+--------------
+
+You can emit your own metrics from inside a task, plugin, or custom operator
through
+the same stats client Airflow uses internally. In Airflow 3 the recommended
import
+path is ``airflow.sdk.observability``:
+
+.. code-block:: python
+
+ from airflow.sdk.observability import stats
+
+ stats.incr("my_service.processed")
+ stats.decr("my_service.in_flight")
+ stats.gauge("my_service.queue_depth", 42)
+ stats.timing("my_service.batch_ms", 1234)
+
+ with stats.timer("my_service.batch"):
+ ...
+
+.. versionadded:: 3.3.0
Review Comment:
Aesthetically it's the same. As long as the text is correct, I don't mind.
I'll leave it up to you to decide how to display it.
--
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]