-
Notifications
You must be signed in to change notification settings - Fork 533
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(opentelemetry-instrumentation-runtime): initial version #1272
feat(opentelemetry-instrumentation-runtime): initial version #1272
Conversation
/** | ||
* Runtime instrumentation for Opentelemetry | ||
*/ | ||
export class RuntimeInstrumentation extends InstrumentationBase { | ||
constructor(_config: RuntimeInstrumentationConfig = {}) { | ||
super("@opentelemetry/instrumentation-runtime", VERSION, _config); | ||
} | ||
|
||
init() { | ||
createEventLoopLagMetrics(this.meter, this._config); | ||
} | ||
} |
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.
I am not sure if this is the approach for "metric only" instrumentation. The host-metrics
module is not using this approach[1].
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1272 +/- ##
==========================================
+ Coverage 96.08% 96.20% +0.12%
==========================================
Files 14 15 +1
Lines 893 923 +30
Branches 191 191
==========================================
+ Hits 858 888 +30
Misses 35 35
|
1e3c802
to
5a4db76
Compare
unit: "seconds", | ||
}) | ||
.addCallback(async (observable) => { | ||
const startTime = process.hrtime(); |
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.
Since the lowest version of Node is 14, process.hrtime.bigint()
can be used instead.
|
||
histogram.enable(); | ||
|
||
createEventLoopLagMetrics(this.meter, histogram); |
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.
A meter can change while the application is running. The metrics need to be recreated on the new meter.
More context on the issue: open-telemetry/opentelemetry-js#3249
@Ugzuzg thanks for the review! Im a bit busy these days, but i'll try to make some time and fix the mentioned issues. Are there any comments on the overall structure that i should address? |
great! We really really need this! :) Is there an ETA as to when it'll be available? |
+1 This feature will be greatly appreciated. <3 |
@mentos1386 any update on this PR? are you still interested in finishing it? |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR was closed because it has been stale for 14 days with no activity. |
Which problem is this PR solving?
Prepares a module for runtime instrumentation, runtime metrics.
Short description of the changes
I have created a new module for runtime instrumentation and added initial example of "event loop lag" metrics.
I would refrain from adding more metrics in this PR to not block it for too long and add new metrics in subsequent PR.
The "event loop lag" metrics are inspired by https://github.com/marcbachmann/opentelemetry-node-metrics which is inspired by https://github.com/siimon/prom-client.