Skip to content

nodejs.eventloop.utilization under instrumentation-runtime-node is a percentage, not a duration #2630

@yawhide

Description

@yawhide

What version of OpenTelemetry are you using?

0.11.0

What version of Node are you using?

20.17.0

What did you do?

I was trying to understand what event loop utilization actually meant and i ended up reading the code here and looking up the nodejs docs.

What did you expect to see?

The metric unit to be a percentage or number

What did you see instead?

The metric unit is seconds

Additional context

on line 48 elu.utilization according to the nodejs docs returns a value between 0 and 1. This represents the percentage of time spend in an active state. Example 0.5 would mean half of the time spent in the event loop is active and half idle.
What I don't understand is how does OTEL convert this value between 0 and 1 into a duration?
I was reading this comment thread on the PR that introduced this code and maybe otel is summing the 0->1 values or something? not sure.
Something smells like a bug to me 🤔

Anyway, I would love to have someone explain to me how this metric works when nodejs is returning a number/percentage but otel reports a duration in seconds

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpkg:instrumentation-runtime-nodepriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions