ferruzzi commented on code in PR #43340:
URL: https://github.com/apache/airflow/pull/43340#discussion_r1825091847
##########
airflow/metrics/otel_logger.py:
##########
@@ -300,6 +305,15 @@ def timer(
"""Timer context manager returns the duration and can be cancelled."""
return _OtelTimer(self, stat, tags)
+ def get_name(self, metric_name: str, tags: Attributes | None = None) ->
str:
Review Comment:
The TLDR on this PR is that StatsD emits metrics as something like
`local_task_job.task_exit.<job_id>.<dag_id>.<task_id>.<return_code>` and
doesn't support tags but OTel emits it as `local_task_job.task_exit` with a
name length limit of (32??) characters but allows a tags dict for the rest, so
rather than emitting everything twice, which is done in a bunch of places in
the code, this change should allow metrics to be emitted once and whatever
metrics backend the user uses can assemble the name (or not) as it needs. So
StatsD will append the tags dict tot he name, OTel will just pass the name
through as provided. Whatever future backend may get added can handle it
however it needs to
Once this is done and merged, Arshia can go through and remove the
duplicates and clean the code up a bit.
--
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]