Problem
--generic-hostname-task-sent-metric replaces the client hostname on celery_task_sent to keep label cardinality bounded when tasks are produced by a dynamic set of clients. The worker side has the same problem (celery_task_runtime and the celery_task_* counters are all labeled with the executing worker's hostname), but no equivalent flag. In autoscaled deployments (for example Kubernetes with KEDA), worker hostnames are ephemeral pod names, so the name × hostname × queue set churns and grows with the size of the worker fleet.
Proposed change
Add a flag mirroring --generic-hostname-task-sent-metric for the worker-executed metrics: label the celery_task_* and celery_task_runtime metrics with a constant hostname instead of the worker's.
I'll open a PR with this proposed change shortly. I'd appreciate feedback!
Problem
--generic-hostname-task-sent-metricreplaces the client hostname oncelery_task_sentto keep label cardinality bounded when tasks are produced by a dynamic set of clients. The worker side has the same problem (celery_task_runtimeand thecelery_task_*counters are all labeled with the executing worker'shostname), but no equivalent flag. In autoscaled deployments (for example Kubernetes with KEDA), worker hostnames are ephemeral pod names, so thename × hostname × queueset churns and grows with the size of the worker fleet.Proposed change
Add a flag mirroring
--generic-hostname-task-sent-metricfor the worker-executed metrics: label thecelery_task_*andcelery_task_runtimemetrics with a constant hostname instead of the worker's.I'll open a PR with this proposed change shortly. I'd appreciate feedback!