I'm seeing two issues with celery_tasks_by_name.
- It goes against the naming recommendation:
Do not put the label names in the metric name, as this introduces redundancy and will cause confusion if the respective labels are aggregated away.
- It duplicates
celery_tasks, which is a Gauge with label [state], adding label (task) [name]. My (basic) understanding of the Prometheus dimensional model is that this shouldn't be necessary - name could be added to celery_tasks and we can still rollup/aggregate by either state or name severally as well as jointly.
So I can already operate on celery_tasks_by_name, aggregating by state and I get the same values as for celery_tasks, but with _by_name still in the metric-name ... highlighting both issues above.
sum(celery_tasks_by_name) by (state)
Element | Value
------------------ | -----
{state="FAILURE"} | 1
{state="RECEIVED"} | 0
{state="STARTED"} | 0
{state="SUCCESS"} | 7
... produces the same as:
celery_tasks
Element | Value
---------------------------------- | -----
celery_tasks{...,state="FAILURE"} | 1
celery_tasks{...,state="RECEIVED"} | 0
celery_tasks{...,state="STARTED"} | 0
celery_tasks{...,state="SUCCESS"} | 7
Obviously if these were consolidated that would be a non-backward-compatible change, so might either justify a switch (either new or old default) or a major version-number bump and release-notes.
Interested in feedback on whether the above looks right. Initially I accepted that the state-alone metric might be for efficiency, but I don't know that it is needed for that.
I'm seeing two issues with
celery_tasks_by_name.celery_tasks, which is a Gauge with label[state], adding label (task)[name]. My (basic) understanding of the Prometheus dimensional model is that this shouldn't be necessary -namecould be added tocelery_tasksand we can still rollup/aggregate by eitherstateornameseverally as well as jointly.So I can already operate on
celery_tasks_by_name, aggregating bystateand I get the same values as forcelery_tasks, but with_by_namestill in the metric-name ... highlighting both issues above.... produces the same as:
Obviously if these were consolidated that would be a non-backward-compatible change, so might either justify a switch (either new or old default) or a major version-number bump and release-notes.
Interested in feedback on whether the above looks right. Initially I accepted that the
state-alone metric might be for efficiency, but I don't know that it is needed for that.