Skip to content

[instrumentation-runtime-node] Subtract resolution from event loop delay values #2794

Open
@BorePlusPlus

Description

@BorePlusPlus
  • This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first

While the documentation on monitorEventLoopDelay from node:perf_hooksis quite sparse on interpreting the data it collects, it appears (both from my local tests) and some examples out there (e.g. Elastic's apm-agent-nodejs and example from nodejs issue) that the numbers reported as event loop delay also include the resolution interval.

In these cases, there’s a pattern of subtracting the resolution interval from the reported values. This raises the question: Should instrumentation-runtime-node do the same?

If not, this subtraction must happen downstream in the tools displaying the data. That adds complexity, especially when multiple services use different resolution intervals—each one needs to manage this adjustment independently and update it whenever the resolution changes.

Curious to hear your thoughts - could/should this normalisation be handled at the instrumentation level?

Cheers!

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