Closed waldoppper closed 8 months ago
Thanks for opening your first issue here! Be sure to follow the issue template!
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
This issue has been closed because it has not received response from the issue author.
Apache Airflow version
Other Airflow 2 version (please specify below)
What happened
[2.2.5] I recently enabled statsd metric emission on my team's deploy and began writing views on the result.
I've found that:
task_id = "load.all"
Result: metric names with too many .-delimiters and grafana views which don't render these task metrics.
What you think should happen instead
Any instance of
Statsd.foo(f'{dag_id}...')
orStatsd.foo(f'{task_id}...')
should probably first sanitize those strings of statsd-sensitive characters.So instead of
Current:
Statsd.timer("dag.{self.task.dag_id}.{self.task.task_id}.duration")
->"dag.DAG.WITH.PERIODS.IN_NAME.TASK.WITH.PERIODS.IN.NAME.duration"
Recommended:
Stats.timer(f"dag.{statsd_sanitize(self.task.dag_id)}.{statsd_sanitize(self.task.task_id)}.duration")
->"dag.DAG_WITH_PERIODS_IN_NAME.TASK_WITH_PERIODS_IN_NAME.duration"
How to reproduce
"dag.DAG.WITH.PERIODS.IN.NAME.TASK.WITH.PERIODS.IN.NAME.duration"
Operating System
debian
Versions of Apache Airflow Providers
Deployment
Official Apache Airflow Helm Chart
Deployment details
Deployed with v8.6.1 of https://github.com/airflow-helm/charts/tree/main/charts/airflow
We wired up a pod to convert statsd->prom using https://github.com/prometheus/statsd_exporter, and use Matcher rules by glob/regex to convert statsd-style metrics into prom-style.
Anything else
No response
Are you willing to submit PR?
Code of Conduct