Skip to content

Ambiguous unit in queue latency #14258

Open
@barend-xebia

Description

@barend-xebia

SDK

Python SDK

Description

Looking at the page https://docs.sentry.io/platforms/python/tracing/instrumentation/custom-instrumentation/queues-module/ there is an ambiguity about the unit of messaging.message.receive.latency.

In the table under "consumer instrumentation", we read:

Data Attribute Type Description
messaging.message.receive.latency number The time in milliseconds that a message awaited processing in queue

(emphasis mine)

However, in the code example, we see

now = datetime.now(timezone.utc)
message_time = datetime.fromtimestamp(message["timestamp"], timezone.utc)
latency = now - message_time

this computation returns a float value in seconds.

Looking at my own instrumented system, I think seconds is correct.

Suggested Solution

Change the description the table to read “seconds” instead of “milliseconds”. I would also include that it's a float, not an int.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions