Skip to content

Incorrect Duration for Celery Monitoring #2078

@rjo100

Description

@rjo100

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.21.1

Steps to Reproduce

Sentry SDK is reporting large, negative durations for terminal check-ins (DONE/FAILED). now() is called here for example to get the current timestamp:

duration=now() - start_timestamp_s,

However, that uses perf_counter() underneath the hood.

return time.perf_counter()

As per python docs, the reference point is undefined, so somehow the initial check-in and closing check-in are running across different threads or systems perhaps, resulting in large negative durations using different reference points
https://docs.python.org/3/library/time.html#time.perf_counter

Expected Result

No issues generated in sentry

Actual Result

Can link to sentry issue

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions