Skip to content
This repository was archived by the owner on Sep 7, 2019. It is now read-only.
This repository was archived by the owner on Sep 7, 2019. It is now read-only.

celery_tasks_by_name duplicates celery_tasks with additional label (name) #35

Description

@javabrett

I'm seeing two issues with celery_tasks_by_name.

  1. 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.

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions