add `nodejs.eventloop.time` metric (#1259)

Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
This commit is contained in:
Marylia Gutierrez 2024-08-14 20:38:41 -04:00 committed by GitHub
parent b3902e2ba3
commit b6793e2df7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 129 additions and 2 deletions

View File

@ -0,0 +1,17 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: nodejs
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adding `nodejs.eventloop.time` metric to Node.js runtime metrics.
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [1259]

View File

@ -59,6 +59,7 @@ body:
- area:log
- area:messaging
- area:network
- area:nodejs
- area:oci
- area:opentracing
- area:os

View File

@ -51,6 +51,7 @@ body:
- area:log
- area:messaging
- area:network
- area:nodejs
- area:oci
- area:opentracing
- area:os

View File

@ -60,6 +60,7 @@ body:
- area:log
- area:messaging
- area:network
- area:nodejs
- area:oci
- area:opentracing
- area:os

View File

@ -72,6 +72,7 @@ Currently, the following namespaces exist:
- [Log](log.md)
- [Messaging](messaging.md)
- [Network](network.md)
- [NodeJS](nodejs.md)
- [OCI](oci.md)
- [OpenTracing](opentracing.md)
- [OS](os.md)

View File

@ -0,0 +1,22 @@
<!--- Hugo front matter used to generate the website version of this page:
--->
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->
# NodeJS
## Node.js Attributes
Describes Node.js related attributes.
| Attribute | Type | Description | Examples | Stability |
| ------------------------ | ------ | ----------------------------- | ---------------- | ---------------------------------------------------------------- |
| `nodejs.eventloop.state` | string | The state of event loop time. | `active`; `idle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`nodejs.eventloop.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
| -------- | ------------ | ---------------------------------------------------------------- |
| `active` | Active time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `idle` | Idle time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

View File

@ -21,6 +21,7 @@ This document describes semantic conventions for Node.js Runtime metrics in Open
- [Metric: `nodejs.eventloop.delay.p90`](#metric-nodejseventloopdelayp90)
- [Metric: `nodejs.eventloop.delay.p99`](#metric-nodejseventloopdelayp99)
- [Metric: `nodejs.eventloop.utilization`](#metric-nodejseventlooputilization)
- [Metric: `nodejs.eventloop.time`](#metric-nodejseventlooptime)
<!-- tocstop -->
@ -316,7 +317,7 @@ This metric is [recommended][MetricRecommended].
| `nodejs.eventloop.utilization` | Gauge | `1` | Event loop utilization. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
**[1]:** The value range is [0.0,1.0] and can be retrieved from value [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)
**[1]:** The value range is [0.0, 1.0] and can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)
@ -333,6 +334,56 @@ This metric is [recommended][MetricRecommended].
<!-- markdownlint-disable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->
### Metric: `nodejs.eventloop.time`
This metric is [recommended][MetricRecommended].
<!-- semconv metric.nodejs.eventloop.time(metric_table) -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `nodejs.eventloop.time` | Counter | `s` | Cumulative duration of time the event loop has been in each state. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
**[1]:** Value can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->
<!-- semconv metric.nodejs.eventloop.time(full) -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`nodejs.eventloop.state`](/docs/attributes-registry/nodejs.md) | string | The state of event loop time. | `active`; `idle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`nodejs.eventloop.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
| `active` | Active time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `idle` | Idle time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->

View File

@ -77,5 +77,19 @@ groups:
unit: "1"
stability: experimental
note: >
The value range is [0.0,1.0] and can be retrieved from value
The value range is [0.0, 1.0] and can be retrieved from
[`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)
- id: metric.nodejs.eventloop.time
type: metric
metric_name: nodejs.eventloop.time
brief: "Cumulative duration of time the event loop has been in each state."
instrument: counter
unit: "s"
stability: experimental
attributes:
- ref: nodejs.eventloop.state
requirement_level: required
note: >
Value can be retrieved from
[`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)

View File

@ -0,0 +1,19 @@
groups:
- id: registry.nodejs
type: attribute_group
brief: Describes Node.js related attributes.
display_name: Node.js Attributes
attributes:
- id: nodejs.eventloop.state
stability: experimental
brief: The state of event loop time.
type:
members:
- id: active
value: 'active'
brief: 'Active time.'
stability: experimental
- id: idle
value: 'idle'
brief: 'Idle time.'
stability: experimental