Skip to content

Commit

Permalink
move nodejs attributes to attributes registry
Browse files Browse the repository at this point in the history
  • Loading branch information
maryliag committed May 1, 2024
1 parent 94c6330 commit 42c6ce3
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .chloggen/nodejs-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ change_type: new_component
component: nodejs

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Introducing semantic conventions for Node.js specific metrics.
note: Introducing semantic conventions for 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.
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,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)
Expand Down
53 changes: 53 additions & 0 deletions docs/attributes-registry/nodejs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!--- 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

## Nodejs Attributes

Describes Node.js related attributes.

| Attribute | Type | Description | Examples | Stability |
| --------------------------- | ------ | ------------------------------- | ------------------------------- | ---------------------------------------------------------------- |
| `nodejs.eventloop.lag.type` | string | The type of memory. | `min`; `max`; `avg` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nodejs.gc.type` | string | The type of garbage collection. | `major`; `minor`; `incremental` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nodejs.memory.state` | string | The state of memory. | `total`; `used` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nodejs.memory.type` | string | The type of memory. | `heap`; `external` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nodejs.version` | string | Node.js version. | `v22.0.0`; `v21.7.3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`nodejs.eventloop.lag.type` 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 |
| ----- | --------------------------------- | ---------------------------------------------------------------- |
| `min` | Event loop minimum latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `max` | Event loop maximum latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `avg` | Event loop average latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `p50` | Event loop 50 percentile latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `p90` | Event loop 90 percentile latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `p99` | Event loop 99 percentile latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`nodejs.gc.type` 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 |
| ------------- | ---------------------------------------- | ---------------------------------------------------------------- |
| `major` | Major (Mark Sweep Compact). | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `minor` | Minor (Scavenge). | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `incremental` | Incremental (Incremental Marking). | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `weakcb` | Weak Callbacks (Process Weak Callbacks). | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`nodejs.memory.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 |
| ------- | ------------- | ---------------------------------------------------------------- |
| `total` | Total memory. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `used` | Used memory | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`nodejs.memory.type` 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 |
| ---------- | --------------- | ---------------------------------------------------------------- |
| `heap` | Heap memory. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `external` | External memory | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2 changes: 1 addition & 1 deletion docs/runtime/nodejs-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ This metric is [recommended][MetricRecommended].
|---|---|---|
| `min` | Event loop minimum latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `max` | Event loop maximum latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `avg` | Event loop average latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `p50` | Event loop 50 percentile latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `p90` | Event loop 90 percentile latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `p99` | Event loop 99 percentile latency. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `avg` | Event loop average lag. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
<!-- endsemconv -->

### Metric: `nodejs.gc.duration`
Expand Down
105 changes: 16 additions & 89 deletions model/metrics/nodejs-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,137 +3,64 @@ groups:
type: metric
metric_name: nodejs.active_handles.count
brief: "Number of active handles."
extends: attributes.nodejs.version
instrument: updowncounter
unit: "{handles}"
stability: experimental
attributes:
- ref: nodejs.version
requirement_level: recommended

- id: metric.nodejs.active_requests.count
type: metric
metric_name: nodejs.active_requests.count
brief: "Number of active requests."
extends: attributes.nodejs.version
instrument: updowncounter
unit: "{requests}"
stability: experimental
attributes:
- ref: nodejs.version
requirement_level: recommended

- id: metric.nodejs.eventloop.lag
type: metric
metric_name: nodejs.eventloop.lag
brief: "Event loop lag."
extends: attributes.nodejs.version
instrument: counter
unit: "s"
stability: experimental
prefix: nodejs.eventloop.lag
attributes:
- id: type
stability: experimental
type:
allow_custom_values: false
members:
- id: min
value: 'min'
brief: 'Event loop minimum latency.'
stability: experimental
- id: max
value: 'max'
brief: 'Event loop maximum latency.'
stability: experimental
- id: p50
value: 'p50'
brief: 'Event loop 50 percentile latency.'
stability: experimental
- id: p90
value: 'p90'
brief: 'Event loop 90 percentile latency.'
stability: experimental
- id: p99
value: 'p99'
brief: 'Event loop 99 percentile latency.'
stability: experimental
- id: avg
value: avg
brief: 'Event loop average lag.'
stability: experimental
- ref: nodejs.version
requirement_level: recommended
- ref: nodejs.eventloop.lag.type
requirement_level: recommended
brief: The type of memory.
examples: ["min", "p90"]


- id: metric.nodejs.gc.duration
type: metric
metric_name: nodejs.gc.duration
brief: "Garbage collection duration."
extends: attributes.nodejs.version
instrument: counter
unit: "s"
stability: experimental
prefix: nodejs.gc
attributes:
- id: type
stability: experimental
- ref: nodejs.version
requirement_level: recommended
- ref: nodejs.gc.type
requirement_level: recommended
brief: The type of garbage collection.
type:
allow_custom_values: false
members:
- id: major
value: 'major'
brief: 'Major (Mark Sweep Compact).'
stability: experimental
- id: minor
value: 'minor'
brief: 'Minor (Scavenge).'
stability: experimental
- id: incremental
value: 'incremental'
brief: 'Incremental (Incremental Marking).'
stability: experimental
- id: weakcb
value: 'weakcb'
brief: 'Weak Callbacks (Process Weak Callbacks).'
stability: experimental

- id: metric.nodejs.memory.size
type: metric
metric_name: nodejs.memory.size
brief: "Memory size."
extends: attributes.nodejs.version
instrument: updowncounter
unit: "By"
stability: experimental
prefix: nodejs.memory
attributes:
- id: type
stability: experimental
type:
allow_custom_values: false
members:
- id: heap
value: 'heap'
brief: 'Heap memory.'
stability: experimental
- id: external
value: 'external'
brief: 'External memory'
stability: experimental
- ref: nodejs.version
requirement_level: recommended
- ref: nodejs.memory.type
requirement_level: recommended
brief: The type of memory.
examples: ["heap", "external"]
- id: state
stability: experimental
type:
allow_custom_values: false
members:
- id: total
value: 'total'
brief: 'Total memory.'
stability: experimental
- id: used
value: 'used'
brief: 'Used memory'
stability: experimental
- ref: nodejs.memory.state
requirement_level: recommended
brief: The state of memory.
examples: ["total", "used"]
88 changes: 85 additions & 3 deletions model/registry/nodejs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,94 @@
groups:
- id: attributes.nodejs.version
- id: registry.nodejs
type: attribute_group
brief: "Describes Node.js version attribute."
brief: Describes Node.js related attributes.
prefix: nodejs
attributes:
- id: version
stability: experimental
type: string
requirement_level: recommended
brief: Node.js version.
examples: ["v22.0.0", "v21.7.3"]
- id: eventloop.lag.type
stability: experimental
type:
allow_custom_values: false
members:
- id: min
value: 'min'
brief: 'Event loop minimum latency.'
stability: experimental
- id: max
value: 'max'
brief: 'Event loop maximum latency.'
stability: experimental
- id: avg
value: avg
brief: 'Event loop average latency.'
stability: experimental
- id: p50
value: 'p50'
brief: 'Event loop 50 percentile latency.'
stability: experimental
- id: p90
value: 'p90'
brief: 'Event loop 90 percentile latency.'
stability: experimental
- id: p99
value: 'p99'
brief: 'Event loop 99 percentile latency.'
stability: experimental
brief: The type of memory.
examples: ["min", "p90"]
- id: gc.type
stability: experimental
brief: The type of garbage collection.
type:
allow_custom_values: false
members:
- id: major
value: 'major'
brief: 'Major (Mark Sweep Compact).'
stability: experimental
- id: minor
value: 'minor'
brief: 'Minor (Scavenge).'
stability: experimental
- id: incremental
value: 'incremental'
brief: 'Incremental (Incremental Marking).'
stability: experimental
- id: weakcb
value: 'weakcb'
brief: 'Weak Callbacks (Process Weak Callbacks).'
stability: experimental
- id: memory.type
stability: experimental
type:
allow_custom_values: false
members:
- id: heap
value: 'heap'
brief: 'Heap memory.'
stability: experimental
- id: external
value: 'external'
brief: 'External memory'
stability: experimental
brief: The type of memory.
examples: ["heap", "external"]
- id: memory.state
stability: experimental
type:
allow_custom_values: false
members:
- id: total
value: 'total'
brief: 'Total memory.'
stability: experimental
- id: used
value: 'used'
brief: 'Used memory'
stability: experimental
brief: The state of memory.
examples: ["total", "used"]

0 comments on commit 42c6ce3

Please sign in to comment.