Add k8s container resource related metrics (#2178)
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
This commit is contained in:
parent
778afe4ec8
commit
a05b3ec82d
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Use this changelog template to create an entry for release notes.
|
||||||
|
#
|
||||||
|
# If your change doesn't affect end users you should instead start
|
||||||
|
# your pull request title with [chore] or use the "Skip Changelog" label.
|
||||||
|
|
||||||
|
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
|
||||||
|
change_type: enhancement
|
||||||
|
|
||||||
|
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
|
||||||
|
component: k8s
|
||||||
|
|
||||||
|
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
|
||||||
|
note: Add K8s container resource related 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.
|
||||||
|
issues: [2074]
|
||||||
|
|
||||||
|
# (Optional) One or more lines of additional information to render under the primary note.
|
||||||
|
# These lines will be padded with 2 spaces and then inserted directly into the document.
|
||||||
|
# Use pipe (|) for multiline entries.
|
||||||
|
subtext:
|
||||||
|
|
@ -57,6 +57,7 @@ and one for disabling the old schema called `semconv.k8s.disableLegacy`. Then:
|
||||||
- [K8s Namespace metrics](#k8s-namespace-metrics)
|
- [K8s Namespace metrics](#k8s-namespace-metrics)
|
||||||
- [K8s ResourceQuota resource](#k8s-resourcequota-resource)
|
- [K8s ResourceQuota resource](#k8s-resourcequota-resource)
|
||||||
- [K8s ReplicationController resource](#k8s-replicationcontroller-resource)
|
- [K8s ReplicationController resource](#k8s-replicationcontroller-resource)
|
||||||
|
- [K8s Container metrics](#k8s-container-metrics)
|
||||||
|
|
||||||
<!-- tocstop -->
|
<!-- tocstop -->
|
||||||
|
|
||||||
|
|
@ -282,4 +283,27 @@ The changes are the following:
|
||||||
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
|
||||||
| `k8s.replication_controller.{name,uid}` | `k8s.replicationcontroller.{name,uid}` |
|
| `k8s.replication_controller.{name,uid}` | `k8s.replicationcontroller.{name,uid}` |
|
||||||
|
|
||||||
|
### K8s Container metrics
|
||||||
|
|
||||||
|
The K8s Container metrics implemented by the Collector and specifically the
|
||||||
|
[k8scluster](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.115.0/receiver/k8sclusterreceiver/documentation.md)
|
||||||
|
receiver were introduced as semantic conventions in
|
||||||
|
[#2178](https://github.com/open-telemetry/semantic-conventions/pull/2178) (TODO: replace with SemConv version once
|
||||||
|
available).
|
||||||
|
|
||||||
|
The changes in their metrics are the following:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
|
||||||
|
| Old (Collector)  | New |
|
||||||
|
|------------------------------------------------------------------------------------|-------------------------------------------|
|
||||||
|
| `k8s.container.cpu_limit` | `k8s.container.cpu.limit` |
|
||||||
|
| `k8s.container.cpu_request` | `k8s.container.cpu.request` |
|
||||||
|
| `k8s.container.memory_limit` | `k8s.container.memory.limit` |
|
||||||
|
| `k8s.container.memory_request` | `k8s.container.memory.request` |
|
||||||
|
| `k8s.container.storage_limit` | `k8s.container.storage.limit` |
|
||||||
|
| `k8s.container.storage_request` | `k8s.container.storage.request` |
|
||||||
|
| `k8s.container.ephemeralstorage_limit` | `k8s.container.ephemeral_storage.limit` |
|
||||||
|
| `k8s.container.ephemeralstorage_request` | `k8s.container.ephemeral_storage.request` |
|
||||||
|
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,15 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`.
|
||||||
- [Metric: `k8s.cronjob.active_jobs`](#metric-k8scronjobactive_jobs)
|
- [Metric: `k8s.cronjob.active_jobs`](#metric-k8scronjobactive_jobs)
|
||||||
- [Namespace metrics](#namespace-metrics)
|
- [Namespace metrics](#namespace-metrics)
|
||||||
- [Metric: `k8s.namespace.phase`](#metric-k8snamespacephase)
|
- [Metric: `k8s.namespace.phase`](#metric-k8snamespacephase)
|
||||||
|
- [K8s Container metrics](#k8s-container-metrics)
|
||||||
|
- [Metric: `k8s.container.cpu.limit`](#metric-k8scontainercpulimit)
|
||||||
|
- [Metric: `k8s.container.cpu.request`](#metric-k8scontainercpurequest)
|
||||||
|
- [Metric: `k8s.container.memory.limit`](#metric-k8scontainermemorylimit)
|
||||||
|
- [Metric: `k8s.container.memory.request`](#metric-k8scontainermemoryrequest)
|
||||||
|
- [Metric: `k8s.container.storage.limit`](#metric-k8scontainerstoragelimit)
|
||||||
|
- [Metric: `k8s.container.storage.request`](#metric-k8scontainerstoragerequest)
|
||||||
|
- [Metric: `k8s.container.ephemeral_storage.limit`](#metric-k8scontainerephemeral_storagelimit)
|
||||||
|
- [Metric: `k8s.container.ephemeral_storage.request`](#metric-k8scontainerephemeral_storagerequest)
|
||||||
|
|
||||||
<!-- tocstop -->
|
<!-- tocstop -->
|
||||||
|
|
||||||
|
|
@ -1089,5 +1098,185 @@ This metric is [recommended][MetricRecommended].
|
||||||
<!-- END AUTOGENERATED TEXT -->
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
<!-- endsemconv -->
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
## K8s Container metrics
|
||||||
|
|
||||||
|
**Description:** K8s Container level metrics captured under the namespace `k8s.container`.
|
||||||
|
|
||||||
|
### Metric: `k8s.container.cpu.limit`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.cpu.limit -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.cpu.limit` | Gauge | `{cpu}` | Maximum CPU resource limit set for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
### Metric: `k8s.container.cpu.request`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.cpu.request -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.cpu.request` | Gauge | `{cpu}` | CPU resource requested for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
### Metric: `k8s.container.memory.limit`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.memory.limit -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.memory.limit` | Gauge | `By` | Maximum memory resource limit set for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
### Metric: `k8s.container.memory.request`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.memory.request -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.memory.request` | Gauge | `By` | Memory resource requested for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
### Metric: `k8s.container.storage.limit`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.storage.limit -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.storage.limit` | Gauge | `By` | Maximum storage resource limit set for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
### Metric: `k8s.container.storage.request`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.storage.request -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.storage.request` | Gauge | `By` | Storage resource requested for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
### Metric: `k8s.container.ephemeral_storage.limit`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.ephemeral_storage.limit -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.ephemeral_storage.limit` | Gauge | `By` | Maximum ephemeral storage resource limit set for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
|
### Metric: `k8s.container.ephemeral_storage.request`
|
||||||
|
|
||||||
|
This metric is [recommended][MetricRecommended].
|
||||||
|
|
||||||
|
<!-- semconv metric.k8s.container.ephemeral_storage.request -->
|
||||||
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
||||||
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|
||||||
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
||||||
|
| `k8s.container.ephemeral_storage.request` | Gauge | `By` | Ephemeral storage resource requested for the container [1] |  | `k8s.container` |
|
||||||
|
|
||||||
|
**[1]:** See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
<!-- END AUTOGENERATED TEXT -->
|
||||||
|
<!-- endsemconv -->
|
||||||
|
|
||||||
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
|
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
|
||||||
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
|
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
|
||||||
|
|
|
||||||
|
|
@ -469,3 +469,93 @@ groups:
|
||||||
attributes:
|
attributes:
|
||||||
- ref: k8s.namespace.phase
|
- ref: k8s.namespace.phase
|
||||||
requirement_level: required
|
requirement_level: required
|
||||||
|
|
||||||
|
# k8s.container.* metrics
|
||||||
|
- id: metric.k8s.container.cpu.limit
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.cpu.limit
|
||||||
|
stability: development
|
||||||
|
brief: "Maximum CPU resource limit set for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "{cpu}"
|
||||||
|
- id: metric.k8s.container.cpu.request
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.cpu.request
|
||||||
|
stability: development
|
||||||
|
brief: "CPU resource requested for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "{cpu}"
|
||||||
|
- id: metric.k8s.container.memory.limit
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.memory.limit
|
||||||
|
stability: development
|
||||||
|
brief: "Maximum memory resource limit set for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "By"
|
||||||
|
- id: metric.k8s.container.memory.request
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.memory.request
|
||||||
|
stability: development
|
||||||
|
brief: "Memory resource requested for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "By"
|
||||||
|
- id: metric.k8s.container.storage.limit
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.storage.limit
|
||||||
|
stability: development
|
||||||
|
brief: "Maximum storage resource limit set for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "By"
|
||||||
|
- id: metric.k8s.container.storage.request
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.storage.request
|
||||||
|
stability: development
|
||||||
|
brief: "Storage resource requested for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "By"
|
||||||
|
- id: metric.k8s.container.ephemeral_storage.limit
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.ephemeral_storage.limit
|
||||||
|
stability: development
|
||||||
|
brief: "Maximum ephemeral storage resource limit set for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "By"
|
||||||
|
- id: metric.k8s.container.ephemeral_storage.request
|
||||||
|
type: metric
|
||||||
|
metric_name: k8s.container.ephemeral_storage.request
|
||||||
|
stability: development
|
||||||
|
brief: "Ephemeral storage resource requested for the container"
|
||||||
|
entity_associations:
|
||||||
|
- k8s.container
|
||||||
|
note: |
|
||||||
|
See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core for details.
|
||||||
|
instrument: gauge
|
||||||
|
unit: "By"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue