diff --git a/.chloggen/nodejs-metrics.yaml b/.chloggen/nodejs-metrics.yaml index a1cdc83de9..19b26bad91 100755 --- a/.chloggen/nodejs-metrics.yaml +++ b/.chloggen/nodejs-metrics.yaml @@ -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. diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index 66f750c036..8ddb09d7df 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -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) diff --git a/docs/attributes-registry/nodejs.md b/docs/attributes-registry/nodejs.md new file mode 100644 index 0000000000..596644c2ee --- /dev/null +++ b/docs/attributes-registry/nodejs.md @@ -0,0 +1,53 @@ + + + + + +# 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) | diff --git a/docs/runtime/nodejs-metrics.md b/docs/runtime/nodejs-metrics.md index ac528ac8aa..b5dbc2d204 100644 --- a/docs/runtime/nodejs-metrics.md +++ b/docs/runtime/nodejs-metrics.md @@ -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) | ### Metric: `nodejs.gc.duration` diff --git a/model/metrics/nodejs-metrics.yaml b/model/metrics/nodejs-metrics.yaml index 542711e579..a600db8aa5 100644 --- a/model/metrics/nodejs-metrics.yaml +++ b/model/metrics/nodejs-metrics.yaml @@ -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"] diff --git a/model/registry/nodejs.yaml b/model/registry/nodejs.yaml index 5bd6f2ca25..97f17c504d 100644 --- a/model/registry/nodejs.yaml +++ b/model/registry/nodejs.yaml @@ -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"] \ No newline at end of file