Skip to content
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

Add v8 js engine runtime metrics semantic conventions #1066

Merged
merged 27 commits into from
Jul 8, 2024

Conversation

maryliag
Copy link
Contributor

Part Of #990

Changes

Adding semantic conventions for V8 Js Engine metrics

Merge requirement checklist

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>
Copy link

github-actions bot commented Jun 8, 2024

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 8, 2024
@maryliag
Copy link
Contributor Author

maryliag commented Jun 8, 2024

friendly ping for reviews

@trask trask removed the Stale label Jun 8, 2024
Copy link
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a first pass, I will try to get more familiar with Nodejs v8 and then look at it again.

model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/registry/v8js.yaml Outdated Show resolved Hide resolved
model/registry/v8js.yaml Outdated Show resolved Hide resolved
Copy link
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Press enter too soon 😓

model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
Copy link
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we have these metrics

v8js.memory.total
v8js.memory.used

v8js.heap.total
v8js.heap.used

That are basically duplicated. Did you consider grouping them in a single v8js.memory.total|used, and then having a v8js.memory.type = heap|non_heap like the JVM one has? https://github.com/open-telemetry/semantic-conventions/blob/main/docs/runtime/jvm-metrics.md#metric-jvmmemoryused

Then you are down to 2 metrics instead of 4.

model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
@joaopgrassi
Copy link
Member

joaopgrassi commented Jun 18, 2024

I also see we use veightjs and v8js in id and metric name. It would be good to be consistent.. and probably best to avoid the number in the metric name. I'd suggest to use veightjs everywhere.

Copy link
Contributor Author

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also see we use veightjs and v8js in id and metric name. It would be good to be consistent.. and probably best to avoid the number in the metric name. I'd suggest to use veightjs everywhere.

I only used the veight version on the ids used to generate the readme, they don't show up in the docs for the final user. I only used because there was a limitation on the docs generation that was not working properly when there were numbers on the ID name. Once a new version of the plugin with the fix is added, this can be updated to use v8. I prefer keeping v8 on the metric name, and not force a limitation of our tooling on the final result to the user. What do you think?

In case you're curios, the PR with the fix: open-telemetry/weaver#152

model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
@legendecas
Copy link
Member

legendecas commented Jun 19, 2024

I'd prefer keeping v8 or V8 since it is the name of the engine.

Once a new version of the plugin with the fix is added, this can be updated to use v8

Sounds good to me

@joaopgrassi
Copy link
Member

@maryliag can you please file an issue so we don't forget to change the ids to use v8js?

Copy link
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the links @maryliag those were helpful for non JS experts like me :D. I think this looks pretty good. I think it would be a good idea to include them in the docs somewhere. Either in each metric or at least in the initial parts of the markdown.

Also: Do you think having some sort of direction on how these metrics are collected makes sense?

One thing I'm thinking is: there's several metrics in the "space" namespace and I wonder if we shouldn't convert that to an actual namespace. So like v8js.heap.space_used_size becomes v8js.heap.space.used_size and etc.

What do you think?

model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
@maryliag
Copy link
Contributor Author

can you please file an issue so we don't forget to change the ids to use v8js?

@joaopgrassi created the issue #1173

@maryliag
Copy link
Contributor Author

Included notes with the links for the v8 functions, so it's more clear where they come from and their names.
Updated the space names, to have space.* instead of space_*

Do you think having some sort of direction on how these metrics are collected makes sense?

Not sure what else could be added for guidance. Someone else has actually started to implement these metrics on open-telemetry/opentelemetry-js-contrib#2136, so for someone who knows this area, should be more straight forward.

model/registry/v8js.yaml Outdated Show resolved Hide resolved
model/registry/v8js.yaml Outdated Show resolved Hide resolved
model/registry/v8js.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Show resolved Hide resolved
model/metrics/v8js-metrics.yaml Show resolved Hide resolved
maryliag and others added 2 commits June 21, 2024 12:26
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
docs/runtime/v8js-metrics.md Outdated Show resolved Hide resolved
docs/runtime/v8js-metrics.md Outdated Show resolved Hide resolved
lmolkova and others added 3 commits June 28, 2024 21:14
@lmolkova
Copy link
Contributor

lmolkova commented Jul 1, 2024

@maryliag curious about CPU - is the plan to report process.cpu.time or follow up with JS-specific CPU metric?

@maryliag
Copy link
Contributor Author

maryliag commented Jul 8, 2024

curious about CPU - is the plan to report process.cpu.time

yes, the plan is to use process.cpu.time

@lmolkova lmolkova merged commit b1ad9ae into open-telemetry:main Jul 8, 2024
11 of 12 checks passed
@maryliag maryliag deleted the v8js-runtime-metrics branch July 8, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants