Skip to content

Queue latency with Celery integration interpreted as milliseconds, whereas it's computed in seconds #4636

@ElstnerM

Description

@ElstnerM

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.339

Steps to Reproduce

  1. Integrate a Celery queue via the Python SDK's Celery Integration
  2. Schedule tasks ending up in this queue
  3. Go to Insights -> Backend -> Queues
  4. Open average duration graph
  5. Look at average time in qeueue
  6. Observe values

Expected Result

Latencies should match the actual time that tasks spent in the queue before being picked up by a worker

Actual Result

Graph shows 1/1000 of the actual values (e.g. instead of displaying seconds, it's displaying milliseconds)

Digging into the JSON raw data of relevant spans, the value messaging.message.receive.latency appears twice in the JSON (see attached screenshot), once without the milli unit and once with it. My hunch is that the unit is inserted erroneously downstream from the Celery integration, and picked up by the graph to show 'ms' on the y axis. The Celery integration definitely computes and writes the value in seconds (see second screenshot).

Image Image

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions