Skip to content

Commit

Permalink
Merge branch 'main' into cf-resource
Browse files Browse the repository at this point in the history
  • Loading branch information
KarstenSchnitter authored Sep 22, 2024
2 parents aa62acd + efea622 commit c0b0a0a
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .chloggen/add_container_csi_attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
change_type: enhancement
component: container
note: >-
Add CSI (Container Storage Interface) attributes:
`container.csi.plugin.name` and `container.csi.volume.id`.
issues: [1119]
subtext:
22 changes: 22 additions & 0 deletions .chloggen/add_k8s_memory_usage.yaml
Original file line number Diff line number Diff line change
@@ -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.pod.memory usage and k8s.node.memory.usage 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: [1406]

# (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:
14 changes: 10 additions & 4 deletions docs/attributes-registry/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,28 @@ A container instance.
| `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. | `["otelcontribcol", "--config", "config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.command_line` | string | The full command run by the container as a single string representing the full command. | `otelcontribcol --config config.yaml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.csi.plugin.name` | string | The name of the CSI ([Container Storage Interface](https://github.com/container-storage-interface/spec)) plugin used by the volume. [2] | `pd.csi.storage.gke.io` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.csi.volume.id` | string | The unique volume ID returned by the CSI ([Container Storage Interface](https://github.com/container-storage-interface/spec)) plugin. [3] | `projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [4] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.repo_digests` | string[] | Repo digests of the container image as provided by the container runtime. [3] | `["example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.repo_digests` | string[] | Repo digests of the container image as provided by the container runtime. [5] | `["example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.tags` | string[] | Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`. | `["v1.27.1", "3.5.7-0"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.label.<key>` | string | Container labels, `<key>` being the label name, the value being the label value. | `container.label.app=nginx` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.name` | string | Container name used by container runtime. | `opentelemetry-autoconf` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.runtime` | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage.

**[2]:** Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint.
**[2]:** This can sometimes be referred to as a "driver" in CSI implementations. This should represent the `name` field of the GetPluginInfo RPC.

**[3]:** This can sometimes be referred to as a "volume handle" in CSI implementations. This should represent the `Volume.volume_id` field in CSI spec.

**[4]:** Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint.
K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
The ID is assigned by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes.

**[3]:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.
**[5]:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.

## Deprecated Container Attributes

Expand Down
50 changes: 50 additions & 0 deletions docs/system/k8s-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,31 @@ This metric is [recommended][MetricRecommended].



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `k8s.pod.memory.usage`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.k8s.pod.memory.usage -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- |
| `k8s.pod.memory.usage` | Gauge | `By` | Memory usage of the Pod [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


**[1]:** Total memory usage of the Pod



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down Expand Up @@ -110,6 +135,31 @@ This metric is [recommended][MetricRecommended].



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `k8s.node.memory.usage`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.k8s.node.memory.usage -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- |
| `k8s.node.memory.usage` | Gauge | `By` | Memory usage of the Node [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


**[1]:** Total memory usage of the Node



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
20 changes: 20 additions & 0 deletions model/container/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,23 @@ groups:
brief: >
Container labels, `<key>` being the label name, the value being the label value.
examples: [ 'container.label.app=nginx' ]
- id: container.csi.plugin.name
type: string
stability: experimental
brief: >
The name of the CSI ([Container Storage Interface](https://github.com/container-storage-interface/spec)) plugin used by the volume.
note: >
This can sometimes be referred to as a "driver" in CSI implementations.
This should represent the `name` field of the GetPluginInfo RPC.
examples:
- "pd.csi.storage.gke.io"
- id: container.csi.volume.id
type: string
stability: experimental
brief: >
The unique volume ID returned by the CSI ([Container Storage Interface](https://github.com/container-storage-interface/spec)) plugin.
note: >
This can sometimes be referred to as a "volume handle" in CSI implementations.
This should represent the `Volume.volume_id` field in CSI spec.
examples:
- "projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk"
22 changes: 22 additions & 0 deletions model/k8s/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ groups:
instrument: gauge
unit: "{cpu}"

# k8s.pod.memory.* metrics
- id: metric.k8s.pod.memory.usage
type: metric
metric_name: k8s.pod.memory.usage
stability: experimental
brief: "Memory usage of the Pod"
note: >
Total memory usage of the Pod
instrument: gauge
unit: "By"

# k8s.node.cpu.* metrics
- id: metric.k8s.node.cpu.time
type: metric
Expand All @@ -38,3 +49,14 @@ groups:
CPU usage of the specific Node on all available CPU cores, averaged over the sample window
instrument: gauge
unit: "{cpu}"

# k8s.node.memory.* metrics
- id: metric.k8s.node.memory.usage
type: metric
metric_name: k8s.node.memory.usage
stability: experimental
brief: "Memory usage of the Node"
note: >
Total memory usage of the Node
instrument: gauge
unit: "By"
9 changes: 5 additions & 4 deletions templates/registry/markdown/weaver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,27 @@ templates:
application_mode: each
acronyms:
- AI
- iOS
- AWS
- CICD
- CloudEvents
- CloudFoundry
- CLR
- CPU
- CSI
- DynamoDB
- ECS
- EKS
- GraphQL
- GCP
- GCE
- GCP
- GraphQL
- HTTP
- iOS
- JVM
- NodeJS
- OCI
- OTel
- OpenTracing
- OS
- OTel
- RabbitMQ
- RocketMQ
- RPC
Expand Down

0 comments on commit c0b0a0a

Please sign in to comment.