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

Clarify how to report the total amount of memory #409

Merged
merged 10 commits into from
Oct 27, 2023
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ release.
([#410](https://github.com/open-telemetry/semantic-conventions/pull/410))
- BREAKING: Factor in `X-Forwarded-Host` / `Forwarded` when capturing `server.address` and `server.port`.
([#411](https://github.com/open-telemetry/semantic-conventions/pull/411))
- BREAKING: Remove `total` from list of well-known values of `system.memory.state` attribute.
([#409](https://github.com/open-telemetry/semantic-conventions/pull/409))

### Features

- Metric namespaces SHOULD NOT be pluralized.
([#267](https://github.com/open-telemetry/opentelemetry-specification/pull/267))
- Add opt-in `system.memory.limit` metric.
([#409](https://github.com/open-telemetry/semantic-conventions/pull/409))

### Fixes

Expand Down
24 changes: 21 additions & 3 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam
* [Metric: `system.cpu.logical.count`](#metric-systemcpulogicalcount)
- [Memory Metrics](#memory-metrics)
* [Metric: `system.memory.usage`](#metric-systemmemoryusage)
* [Metric: `system.memory.limit`](#metric-systemmemorylimit)
* [Metric: `system.memory.utilization`](#metric-systemmemoryutilization)
- [Paging/Swap Metrics](#pagingswap-metrics)
* [Metric: `system.paging.usage`](#metric-systempagingusage)
Expand Down Expand Up @@ -157,7 +158,10 @@ This metric is [recommended][MetricRecommended].
<!-- semconv metric.system.memory.usage(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `system.memory.usage` | UpDownCounter | `By` | |
| `system.memory.usage` | UpDownCounter | `By` | Reports memory in use by state. [1] |

**[1]:** The sum over all `system.memory.state` values SHOULD equal the total memory
available on the system, that is `system.memory.limit`.
<!-- endsemconv -->

<!-- semconv metric.system.memory.usage(full) -->
Expand All @@ -169,14 +173,28 @@ This metric is [recommended][MetricRecommended].

| Value | Description |
|---|---|
| `total` | total |
| `used` | used |
| `free` | free |
| `shared` | shared |
| `buffers` | buffers |
| `cached` | cached |
<!-- endsemconv -->

### Metric: `system.memory.limit`

This metric is [opt-in][MetricOptIn].

<!-- semconv metric.system.memory.limit(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `system.memory.limit` | UpDownCounter | `By` | Total memory available in the system. [1] |

**[1]:** Its value SHOULD equal the sum of `system.memory.state` over all states.
<!-- endsemconv -->

<!-- semconv metric.system.memory.limit(full) -->
<!-- endsemconv -->

### Metric: `system.memory.utilization`

This metric is [recommended][MetricRecommended].
Expand All @@ -196,7 +214,6 @@ This metric is [recommended][MetricRecommended].

| Value | Description |
|---|---|
| `total` | total |
| `used` | used |
| `free` | free |
| `shared` | shared |
Expand Down Expand Up @@ -752,6 +769,7 @@ an `{os}` prefix to split this metric across OSes.

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#recommended
[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#opt-in

### Metric: `system.linux.memory.available`

Expand Down
16 changes: 13 additions & 3 deletions model/metrics/system-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ groups:
type:
allow_custom_values: true
members:
- id: total
value: 'total'
- id: used
value: 'used'
- id: free
Expand All @@ -105,12 +103,24 @@ groups:
- id: metric.system.memory.usage
type: metric
metric_name: system.memory.usage
brief: ""
brief: "Reports memory in use by state."
note: |
The sum over all `system.memory.state` values SHOULD equal the total memory
ChrsMark marked this conversation as resolved.
Show resolved Hide resolved
available on the system, that is `system.memory.limit`.
instrument: updowncounter
unit: "By"
attributes:
- ref: system.memory.state

- id: metric.system.memory.limit
type: metric
metric_name: system.memory.limit
brief: "Total memory available in the system."
note: |
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
Its value SHOULD equal the sum of `system.memory.state` over all states.
instrument: updowncounter
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
unit: "By"

- id: metric.system.memory.utilization
type: metric
metric_name: system.memory.utilization
Expand Down
Loading