-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add span metrics processor #849
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
base: main
Are you sure you want to change the base?
Conversation
@@ -129,6 +130,7 @@ | |||
"@opentelemetry/sdk-logs": "^0.202.0", | |||
"@opentelemetry/sdk-metrics": "^2.0.0", | |||
"@opentelemetry/sdk-node": "^0.202.0", | |||
"@opentelemetry/sdk-trace-base": "^2.0.1", |
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.
note to reviewer: added to make the linter happy but this is a dependency of @opentelemetry/sdk-node
which is going to be installed regardless if here or not. I worry if this may lead to some side effects
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.
Should be fine. However, I'd look into updating the other ^2.0.0
otel deps to ^2.0.1
as well. E.g.: sdk-metrics.
@@ -34,6 +34,9 @@ const testFixtures = [ | |||
t.ok(hasLog(`name: 'nodejs.eventloop.delay.min'`)); | |||
t.ok(hasLog(`name: 'nodejs.eventloop.delay.max'`)); | |||
t.ok(hasLog(`name: 'process.cpu.utilization'`)); | |||
t.ok(hasLog(`name: 'process.cpu.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.
note to reviewer: I think this is the best place to check the metrics EDOT is collecting. If disagree I can create a new test file.
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.
Is this a duplicate line?
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.
yes!
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.
If the intent is to just implement a subset (two) of the SDK metrics mentioned in https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics please update the description to say so. Also need to update to https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics as the reference because the PR is out of date (e.g. otel.sdk.span.live.count
-> otel.sdk.span.live
).
@@ -129,6 +130,7 @@ | |||
"@opentelemetry/sdk-logs": "^0.202.0", | |||
"@opentelemetry/sdk-metrics": "^2.0.0", | |||
"@opentelemetry/sdk-node": "^0.202.0", | |||
"@opentelemetry/sdk-trace-base": "^2.0.1", |
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.
Should be fine. However, I'd look into updating the other ^2.0.0
otel deps to ^2.0.1
as well. E.g.: sdk-metrics.
Updated the title and description of the PR :) |
ready for another round of review @trentm |
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.
Sorry for taking so long to re-review.
@@ -34,6 +34,9 @@ const testFixtures = [ | |||
t.ok(hasLog(`name: 'nodejs.eventloop.delay.min'`)); | |||
t.ok(hasLog(`name: 'nodejs.eventloop.delay.max'`)); | |||
t.ok(hasLog(`name: 'process.cpu.utilization'`)); | |||
t.ok(hasLog(`name: 'process.cpu.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.
Is this a duplicate line?
Co-authored-by: Trent Mick <[email protected]>
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.
LGTM
Co-authored-by: Trent Mick <[email protected]>
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 just saw open-telemetry/semantic-conventions#2431
We should understand that before merging this.
This PR adds the following OTEL SDK metrics:
Summary of changes:
processors.js
module to resolve processors set via env or via configuration optionssdk-metrics.js
module which exportssetupSdkMetrics
method. The method is used to add a new Span processor which keeps the counters up to date whenever a Span starts or ends.