Skip to content

Commit a44ff76

Browse files
rogercolllmolkovatrisch-mejoaopgrassi
authored
add system.linux.memory.slab to system metrics (#1078)
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> Co-authored-by: Alexandra Konrad <alexandra.konrad@elastic.co> Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
1 parent 2ac36a5 commit a44ff76

File tree

9 files changed

+134
-0
lines changed

9 files changed

+134
-0
lines changed

.chloggen/add_linux_memory_slab.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: enhancement
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: linux
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: Add the `system.linux.memory.slab.usage` metric and the `linux.memory.slab.state` attributes.
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [531]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
subtext:

.github/ISSUE_TEMPLATE/bug_report.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ body:
5252
- area:http
5353
- area:jvm
5454
- area:k8s
55+
- area:linux
5556
- area:log
5657
- area:messaging
5758
- area:network

.github/ISSUE_TEMPLATE/change_proposal.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ body:
4545
- area:http
4646
- area:jvm
4747
- area:k8s
48+
- area:linux
4849
- area:log
4950
- area:messaging
5051
- area:network

.github/ISSUE_TEMPLATE/new-conventions.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ body:
5454
- area:http
5555
- area:jvm
5656
- area:k8s
57+
- area:linux
5758
- area:log
5859
- area:messaging
5960
- area:network

docs/attributes-registry/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Currently, the following namespaces exist:
6666
- [iOS](ios.md)
6767
- [JVM](jvm.md)
6868
- [K8s](k8s.md)
69+
- [Linux](linux.md)
6970
- [Log](log.md)
7071
- [Messaging](messaging.md)
7172
- [Network](network.md)

docs/attributes-registry/linux.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--- Hugo front matter used to generate the website version of this page:
2+
--->
3+
4+
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
5+
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->
6+
7+
# Linux
8+
9+
## Linux Memory Attributes
10+
11+
Describes Linux Memory attributes
12+
13+
| Attribute | Type | Description | Examples | Stability |
14+
| ------------------------- | ------ | --------------------------- | ------------------------------ | ---------------------------------------------------------------- |
15+
| `linux.memory.slab.state` | string | The Linux Slab memory state | `reclaimable`; `unreclaimable` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
16+
17+
`linux.memory.slab.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.
18+
19+
| Value | Description | Stability |
20+
| --------------- | ------------- | ---------------------------------------------------------------- |
21+
| `reclaimable` | reclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
22+
| `unreclaimable` | unreclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

docs/system/system-metrics.md

+53
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam
5757
- [Metric: `system.process.created`](#metric-systemprocesscreated)
5858
- [`system.{os}.` - OS Specific System Metrics](#systemos---os-specific-system-metrics)
5959
- [Metric: `system.linux.memory.available`](#metric-systemlinuxmemoryavailable)
60+
- [Metric: `system.linux.memory.slab.usage`](#metric-systemlinuxmemoryslabusage)
6061

6162
<!-- tocstop -->
6263

@@ -1475,6 +1476,58 @@ See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5
14751476

14761477

14771478

1479+
<!-- markdownlint-restore -->
1480+
<!-- prettier-ignore-end -->
1481+
<!-- END AUTOGENERATED TEXT -->
1482+
<!-- endsemconv -->
1483+
1484+
### Metric: `system.linux.memory.slab.usage`
1485+
1486+
This metric is [recommended][MetricRecommended].
1487+
1488+
<!-- semconv metric.system.linux.memory.slab.usage(metric_table) -->
1489+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1490+
<!-- see templates/registry/markdown/snippet.md.j2 -->
1491+
<!-- prettier-ignore-start -->
1492+
<!-- markdownlint-capture -->
1493+
<!-- markdownlint-disable -->
1494+
1495+
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
1496+
| -------- | --------------- | ----------- | -------------- | --------- |
1497+
| `system.linux.memory.slab.usage` | UpDownCounter | `By` | Reports the memory used by the Linux kernel for managing caches of frequently used objects. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
1498+
1499+
1500+
**[1]:** The sum over the `reclaimable` and `unreclaimable` state values in `linux.memory.slab.usage` SHOULD be equal to the total slab memory available on the system.
1501+
Note that the total slab memory is not constant and may vary over time.
1502+
See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics) and `Slab` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html).
1503+
1504+
1505+
1506+
<!-- markdownlint-restore -->
1507+
<!-- prettier-ignore-end -->
1508+
<!-- END AUTOGENERATED TEXT -->
1509+
<!-- endsemconv -->
1510+
1511+
<!-- semconv metric.system.linux.memory.slab.usage(full) -->
1512+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1513+
<!-- see templates/registry/markdown/snippet.md.j2 -->
1514+
<!-- prettier-ignore-start -->
1515+
<!-- markdownlint-capture -->
1516+
<!-- markdownlint-disable -->
1517+
1518+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
1519+
|---|---|---|---|---|---|
1520+
| [`linux.memory.slab.state`](/docs/attributes-registry/linux.md) | string | The Linux Slab memory state | `reclaimable`; `unreclaimable` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
1521+
1522+
`linux.memory.slab.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.
1523+
1524+
| Value | Description | Stability |
1525+
|---|---|---|
1526+
| `reclaimable` | reclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
1527+
| `unreclaimable` | unreclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
1528+
1529+
1530+
14781531
<!-- markdownlint-restore -->
14791532
<!-- prettier-ignore-end -->
14801533
<!-- END AUTOGENERATED TEXT -->

model/metrics/system-metrics.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,17 @@ groups:
342342
instrument: updowncounter
343343
unit: "By"
344344
attributes: []
345+
346+
- id: metric.system.linux.memory.slab.usage
347+
type: metric
348+
metric_name: system.linux.memory.slab.usage
349+
stability: experimental
350+
brief: "Reports the memory used by the Linux kernel for managing caches of frequently used objects."
351+
note: |
352+
The sum over the `reclaimable` and `unreclaimable` state values in `linux.memory.slab.usage` SHOULD be equal to the total slab memory available on the system.
353+
Note that the total slab memory is not constant and may vary over time.
354+
See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics) and `Slab` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html).
355+
instrument: updowncounter
356+
unit: "By"
357+
attributes:
358+
- ref: linux.memory.slab.state

model/registry/linux.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
groups:
2+
# linux.memory.* attribute group
3+
- id: registry.linux.memory
4+
prefix: linux.memory
5+
type: attribute_group
6+
brief: "Describes Linux Memory attributes"
7+
attributes:
8+
- id: slab.state
9+
type:
10+
members:
11+
- id: reclaimable
12+
value: 'reclaimable'
13+
stability: experimental
14+
- id: unreclaimable
15+
value: 'unreclaimable'
16+
stability: experimental
17+
stability: experimental
18+
brief: "The Linux Slab memory state"
19+
examples: ["reclaimable", "unreclaimable"]

0 commit comments

Comments
 (0)