open-telemetry / open-telemetry/opentelemetry-python-contrib

Improve metrics in Celery instrumentation

Open
#3,458 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

What problem do you want to solve?

Our instrumented Celery applications often are deployed along with Celery Flower to monitor a few metrics on tasks and workers. But those metrics can also be made available through auto-instrumentation. I am sure for those whose usage of Flower is limited having it all in a single instrumentation would be beneficial.

Describe the solution you'd like
  • Add metrics from Celery Flower, i.e. counts for executing and prefetched tasks as well as prefetch and execution duration of a task.
  • Rename those metrics according to OTel semantic conventions
  • Fix a memory leak in current metrics generation (this entry never gets removed)
Describe alternatives you've considered

No response

Additional Context

I got some parts working in my local environment but testing has been a challenge. I don't think I ever had all unit tests passing even in clean setup. I have no idea if it's something in my own environment as Celery tests appear to be generally green in PRs.

Would you like to implement a fix?

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/init.py, around the metrics-generation entry cited in the issue. Review the existing Celery instrumentation and its unit tests, then verify the requested Flower metrics, OpenTelemetry naming, and removal of retained entries so the memory leak is fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.