Skip to content

Commit 479cf33

Browse files
committed
chore: Add v8js.memory.heap.max metric for absolute heap size limit
Add v8js.memory.heap.max gauge metric representing the absolute maximum heap size (heap_size_limit) from v8.getHeapStatistics(). This value is the hard ceiling controlled by --max-old-space-size or V8 defaults. Related issue: open-telemetry#3476 Related instrumentation PR: open-telemetry/opentelemetry-js-contrib#3405
1 parent 084f18e commit 479cf33

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
change_type: enhancement
2+
component: v8js
3+
note: Add `v8js.memory.heap.max` gauge for the absolute maximum heap size from `v8.getHeapStatistics()`.
4+
issues: [3476]

docs/runtime/v8js-metrics.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This document describes semantic conventions for V8 JS Engine Runtime metrics in
1515
- [Metric: `v8js.memory.heap.used`](#metric-v8jsmemoryheapused)
1616
- [Metric: `v8js.memory.heap.space.available_size`](#metric-v8jsmemoryheapspaceavailable_size)
1717
- [Metric: `v8js.memory.heap.space.physical_size`](#metric-v8jsmemoryheapspacephysical_size)
18+
- [Metric: `v8js.memory.heap.max`](#metric-v8jsmemoryheapmax)
1819

1920
<!-- tocstop -->
2021

@@ -214,5 +215,24 @@ This metric is [recommended][MetricRecommended].
214215
<!-- END AUTOGENERATED TEXT -->
215216
<!-- endsemconv -->
216217

218+
## Metric: `v8js.memory.heap.max`
219+
220+
This metric is [recommended][MetricRecommended].
221+
222+
<!-- semconv metric.v8js.memory.heap.max -->
223+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
224+
<!-- see templates/registry/markdown/snippet.md.j2 -->
225+
<!-- prettier-ignore-start -->
226+
227+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
228+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
229+
| `v8js.memory.heap.max` | Gauge | `By` | Maximum heap size allowed by the V8 engine. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |
230+
231+
**[1]:** The value can be retrieved from value `heap_size_limit` of [`v8.getHeapStatistics()`](https://nodejs.org/api/v8.html#v8getheapstatistics). This represents the absolute ceiling the heap can grow to, controlled by `--max-old-space-size` or V8 defaults.
232+
233+
<!-- prettier-ignore-end -->
234+
<!-- END AUTOGENERATED TEXT -->
235+
<!-- endsemconv -->
236+
217237
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.54.0/specification/document-status.md
218238
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended

model/v8js/metrics.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,19 @@ groups:
8080
requirement_level: required
8181
note: >
8282
Value can be retrieved from value `physical_space_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)
83+
84+
- id: metric.v8js.memory.heap.max
85+
type: metric
86+
metric_name: v8js.memory.heap.max
87+
annotations:
88+
code_generation:
89+
metric_value_type: int
90+
brief: "Maximum heap size allowed by the V8 engine."
91+
instrument: gauge
92+
unit: "By"
93+
stability: development
94+
note: >
95+
The value can be retrieved from value `heap_size_limit` of
96+
[`v8.getHeapStatistics()`](https://nodejs.org/api/v8.html#v8getheapstatistics).
97+
This represents the absolute ceiling the heap can grow to, controlled by
98+
`--max-old-space-size` or V8 defaults.

0 commit comments

Comments
 (0)