-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(perf_hooks): add node instrumentation perf_hooks #1902
feat(perf_hooks): add node instrumentation perf_hooks #1902
Conversation
// the Meter (result of @opentelemetry/api's getMeter) is available as this.meter within this method | ||
override _updateMetricInstruments() { | ||
this.meter | ||
.createObservableGauge('nodejs.performance.event_loop.utilization', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to the question from the PR body, I think omitting performance should be just fine 🙂
.createObservableGauge('nodejs.performance.event_loop.utilization', { | |
.createObservableGauge('nodejs.event_loop.utilization', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this 🙂
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1902 +/- ##
==========================================
+ Coverage 91.00% 91.04% +0.04%
==========================================
Files 146 147 +1
Lines 7493 7530 +37
Branches 1503 1507 +4
==========================================
+ Hits 6819 6856 +37
Misses 674 674
|
Updated to fix the failed |
I believe the unit-test (18.18.2) failed due to the test being flakey (c0ef756 should have fixed it) However, I am struggling to see why unit-test (14) hangs and I don't see any test output. (would 928f8ac have fixed it? It's currently passing on my machine using Node.js v14.21.3) @pichlermarc can we run the tests again? |
@pichlermarc Hey, just want to double check if there are still changes that needs addressing, or we are just waiting for this to be included in the next release. Should I keep merging/resolving conflicts (which will cause the tests to be rerun) or just leave it be? Thanks |
Sorry for the delay. I should've merged it long ago. Running tests again and then this should be good to merge. |
(Sorry this Q comes after this is reviewed and merged.) Is this something that needs to be implemented as an instrumentation? Could it not be something like host-metrics (https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/packages/opentelemetry-host-metrics/README.md#usage) where one separately creates and starts it after a MeterProvider has been registered (via using NodeSDK or whatever). IIUC, this isn't actually instrumenting |
Yes, this is only using
The purpose of the package is to export metrics exposed by the Node.js runtime. I see similar packages in other languages (e.g. Go) exposing the language runtime internals implemented as instrumentation packages. If it is a matter of naming, I would be happy for it to be renamed to If it is a matter of whether it should be a non-instrumentation package, I would need more guidance from the maintainers as to the distinction between an 'instrumentation' package and other types of packages. From my perspective, yes, it could work as a package similar to |
Which problem is this PR solving?
#1106 - currently there is no Otel way to expose metrics provided by the Node.js runtime
(...continuation from #1272 and #1689)
Description of changes
This PR adds a
@opentelemetry/instrumentation-perf-hooks
package that exposes theutilization
measurement from Node.js Performance measurement APIs'performance.eventLoopUtilization
method.The exposed metric will look something like this:
Notes / Questions
@opentelemetry/instrumentation-perf-hooks
as this initial version only exposes one metric. Happy to use@opentelemetry/instrumentation-runtime
but that implies a bigger scope than what this PR does.nodejs.performance.event_loop.utilization
, but perhapsnodejs.event_loop.utilization
is sufficient?