Skip to content

Commit d592c26

Browse files
odubajDTthompson-tomo
authored andcommitted
[k8s] Add k8s node allocatable metrics (open-telemetry#2267)
Signed-off-by: odubajDT <[email protected]>
1 parent 8363835 commit d592c26

File tree

4 files changed

+162
-0
lines changed

4 files changed

+162
-0
lines changed
Lines changed: 22 additions & 0 deletions
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: k8s
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: Add `k8s.node.allocatable.cpu`, `k8s.node.allocatable.ephemeral_storage`, `k8s.node.allocatable.memory`, `k8s.node.allocatable.pods` metrics
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: [2243]
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:

docs/non-normative/k8s-migration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ and one for disabling the old schema called `semconv.k8s.disableLegacy`. Then:
4646

4747
- [Summary of changes](#summary-of-changes)
4848
- [K8s network metrics](#k8s-network-metrics)
49+
- [K8s Node allocatable metrics](#k8s-node-allocatable-metrics)
4950
- [K8s Deployment metrics](#k8s-deployment-metrics)
5051
- [K8s ReplicaSet metrics](#k8s-replicaset-metrics)
5152
- [K8s ReplicationController metrics](#k8s-replicationcontroller-metrics)
@@ -85,6 +86,25 @@ The changes in their attributes are the following:
8586

8687
<!-- prettier-ignore-end -->
8788

89+
### K8s Node allocatable metrics
90+
91+
The K8s node allocatable metrics implemented by the Collector and specifically the
92+
[k8scluster](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.127.0/receiver/k8sclusterreceiver/documentation.md)
93+
receiver.
94+
95+
The changes between collector implementation and semantic conventions:
96+
97+
<!-- prettier-ignore-start -->
98+
99+
| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New |
100+
|------------------------------------------------------------------------------------|------------------------------------------------------------------|
101+
| `k8s.node.allocatable_cpu` (type: `gauge`) | `k8s.node.allocatable.cpu` (type: `updowncounter`) |
102+
| `k8s.node.allocatable_memory` (type: `gauge`) | `k8s.node.allocatable.memory` (type: `updowncounter`) |
103+
| `k8s.node.allocatable_ephemeral_storage` (type: `gauge`) | `k8s.node.allocatable.ephemeral_storage` (type: `updowncounter`) |
104+
| `k8s.node.allocatable_pods` (type: `gauge`) | `k8s.node.allocatable.pods` (type: `updowncounter`) |
105+
106+
<!-- prettier-ignore-end -->
107+
88108
### K8s Deployment metrics
89109

90110
The K8s Deployment metrics implemented by the Collector and specifically the

docs/system/k8s-metrics.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`.
2929
- [Metric: `k8s.container.status.reason`](#metric-k8scontainerstatusreason)
3030
- [Node metrics](#node-metrics)
3131
- [Metric: `k8s.node.uptime`](#metric-k8snodeuptime)
32+
- [Metric: `k8s.node.allocatable.cpu`](#metric-k8snodeallocatablecpu)
33+
- [Metric: `k8s.node.allocatable.memory`](#metric-k8snodeallocatablememory)
34+
- [Metric: `k8s.node.allocatable.ephemeral_storage`](#metric-k8snodeallocatableephemeral_storage)
35+
- [Metric: `k8s.node.allocatable.pods`](#metric-k8snodeallocatablepods)
3236
- [Metric: `k8s.node.cpu.time`](#metric-k8snodecputime)
3337
- [Metric: `k8s.node.cpu.usage`](#metric-k8snodecpuusage)
3438
- [Metric: `k8s.node.memory.usage`](#metric-k8snodememoryusage)
@@ -354,6 +358,86 @@ The actual accuracy would depend on the instrumentation and operating system.
354358
<!-- END AUTOGENERATED TEXT -->
355359
<!-- endsemconv -->
356360

361+
### Metric: `k8s.node.allocatable.cpu`
362+
363+
This metric is [recommended][MetricRecommended].
364+
365+
<!-- semconv metric.k8s.node.allocatable.cpu -->
366+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
367+
<!-- see templates/registry/markdown/snippet.md.j2 -->
368+
<!-- prettier-ignore-start -->
369+
<!-- markdownlint-capture -->
370+
<!-- markdownlint-disable -->
371+
372+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
373+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
374+
| `k8s.node.allocatable.cpu` | UpDownCounter | `{cpu}` | Amount of cpu allocatable on the node | ![Development](https://img.shields.io/badge/-development-blue) | `k8s.node` |
375+
376+
<!-- markdownlint-restore -->
377+
<!-- prettier-ignore-end -->
378+
<!-- END AUTOGENERATED TEXT -->
379+
<!-- endsemconv -->
380+
381+
### Metric: `k8s.node.allocatable.memory`
382+
383+
This metric is [recommended][MetricRecommended].
384+
385+
<!-- semconv metric.k8s.node.allocatable.memory -->
386+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
387+
<!-- see templates/registry/markdown/snippet.md.j2 -->
388+
<!-- prettier-ignore-start -->
389+
<!-- markdownlint-capture -->
390+
<!-- markdownlint-disable -->
391+
392+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
393+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
394+
| `k8s.node.allocatable.memory` | UpDownCounter | `By` | Amount of memory allocatable on the node | ![Development](https://img.shields.io/badge/-development-blue) | `k8s.node` |
395+
396+
<!-- markdownlint-restore -->
397+
<!-- prettier-ignore-end -->
398+
<!-- END AUTOGENERATED TEXT -->
399+
<!-- endsemconv -->
400+
401+
### Metric: `k8s.node.allocatable.ephemeral_storage`
402+
403+
This metric is [recommended][MetricRecommended].
404+
405+
<!-- semconv metric.k8s.node.allocatable.ephemeral_storage -->
406+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
407+
<!-- see templates/registry/markdown/snippet.md.j2 -->
408+
<!-- prettier-ignore-start -->
409+
<!-- markdownlint-capture -->
410+
<!-- markdownlint-disable -->
411+
412+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
413+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
414+
| `k8s.node.allocatable.ephemeral_storage` | UpDownCounter | `By` | Amount of ephemeral-storage allocatable on the node | ![Development](https://img.shields.io/badge/-development-blue) | `k8s.node` |
415+
416+
<!-- markdownlint-restore -->
417+
<!-- prettier-ignore-end -->
418+
<!-- END AUTOGENERATED TEXT -->
419+
<!-- endsemconv -->
420+
421+
### Metric: `k8s.node.allocatable.pods`
422+
423+
This metric is [recommended][MetricRecommended].
424+
425+
<!-- semconv metric.k8s.node.allocatable.pods -->
426+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
427+
<!-- see templates/registry/markdown/snippet.md.j2 -->
428+
<!-- prettier-ignore-start -->
429+
<!-- markdownlint-capture -->
430+
<!-- markdownlint-disable -->
431+
432+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
433+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
434+
| `k8s.node.allocatable.pods` | UpDownCounter | `{pod}` | Amount of pods allocatable on the node | ![Development](https://img.shields.io/badge/-development-blue) | `k8s.node` |
435+
436+
<!-- markdownlint-restore -->
437+
<!-- prettier-ignore-end -->
438+
<!-- END AUTOGENERATED TEXT -->
439+
<!-- endsemconv -->
440+
357441
### Metric: `k8s.node.cpu.time`
358442

359443
This metric is [recommended][MetricRecommended].

model/k8s/metrics.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,42 @@ groups:
102102
The actual accuracy would depend on the instrumentation and operating system.
103103
instrument: gauge
104104
unit: "s"
105+
- id: metric.k8s.node.allocatable.cpu
106+
type: metric
107+
metric_name: k8s.node.allocatable.cpu
108+
stability: development
109+
brief: "Amount of cpu allocatable on the node"
110+
entity_associations:
111+
- k8s.node
112+
instrument: updowncounter
113+
unit: "{cpu}"
114+
- id: metric.k8s.node.allocatable.ephemeral_storage
115+
type: metric
116+
metric_name: k8s.node.allocatable.ephemeral_storage
117+
stability: development
118+
brief: "Amount of ephemeral-storage allocatable on the node"
119+
entity_associations:
120+
- k8s.node
121+
instrument: updowncounter
122+
unit: "By"
123+
- id: metric.k8s.node.allocatable.memory
124+
type: metric
125+
metric_name: k8s.node.allocatable.memory
126+
stability: development
127+
brief: "Amount of memory allocatable on the node"
128+
entity_associations:
129+
- k8s.node
130+
instrument: updowncounter
131+
unit: "By"
132+
- id: metric.k8s.node.allocatable.pods
133+
type: metric
134+
metric_name: k8s.node.allocatable.pods
135+
stability: development
136+
brief: "Amount of pods allocatable on the node"
137+
entity_associations:
138+
- k8s.node
139+
instrument: updowncounter
140+
unit: "{pod}"
105141
# k8s.node.cpu.* metrics
106142
- id: metric.k8s.node.cpu.time
107143
type: metric

0 commit comments

Comments
 (0)