diff --git a/.chloggen/complete_k8s_entities.yaml b/.chloggen/complete_k8s_entities.yaml new file mode 100644 index 0000000000..32b83eb3f7 --- /dev/null +++ b/.chloggen/complete_k8s_entities.yaml @@ -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: Define missing roles for entity attributes + +# 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: [3135] + +# (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: diff --git a/docs/registry/entities/k8s.md b/docs/registry/entities/k8s.md index 0768306b88..3652542f13 100644 --- a/docs/registry/entities/k8s.md +++ b/docs/registry/entities/k8s.md @@ -51,16 +51,13 @@ conflict. **Description:** A container in a [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). -> :warning: This entity definition contains attributes without a role. -> Stable Entities MUST NOT have attributes without a defined role. - **Attributes:** | Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | | --- | --- | --- | --- | --- | --- | --- | -| Other | [`k8s.container.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | -| Other | [`k8s.container.restart_count`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | -| Other | [`k8s.container.status.last_terminated_reason`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Last terminated reason of the Container. | `Evicted`; `Error` | +| Identity | [`k8s.container.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | +| Identity | [`k8s.container.restart_count`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | +| Description | [`k8s.container.status.last_terminated_reason`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Last terminated reason of the Container. | `Evicted`; `Error` | ## K8s Cronjob @@ -218,17 +215,13 @@ conflict. **Description:** A Kubernetes Namespace. -> :warning: This entity definition contains attributes without a role. -> Stable Entities MUST NOT have attributes without a defined role. - **Attributes:** | Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | | --- | --- | --- | --- | --- | --- | --- | -| Other | [`k8s.namespace.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the namespace that the pod is running in. | `default` | -| Other | [`k8s.namespace.annotation.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The annotation placed on the Namespace, the `` being the annotation name, the value being the annotation value, even if the value is empty. [13] | `0`; `` | -| Other | [`k8s.namespace.label.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The label placed on the Namespace, the `` being the label name, the value being the label value, even if the value is empty. [14] | `default`; `` | - +| Identity | [`k8s.namespace.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the namespace that the pod is running in. | `default` | +| Description | [`k8s.namespace.annotation.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The annotation placed on the Namespace, the `` being the annotation name, the value being the annotation value, even if the value is empty. [13] | `0`; `` | +| Description | [`k8s.namespace.label.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The label placed on the Namespace, the `` being the label name, the value being the label value, even if the value is empty. [14] | `default`; `` | **[13] `k8s.namespace.annotation.`:** Examples: diff --git a/docs/resource/k8s/README.md b/docs/resource/k8s/README.md index 15878a9e90..355df49db4 100644 --- a/docs/resource/k8s/README.md +++ b/docs/resource/k8s/README.md @@ -124,17 +124,13 @@ a namespace, but not across namespaces. **Description:** A Kubernetes Namespace. -> :warning: This entity definition contains attributes without a role. -> Stable Entities MUST NOT have attributes without a defined role. - **Attributes:** | Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | | --- | --- | --- | --- | --- | --- | --- | -| Other | [`k8s.namespace.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the namespace that the pod is running in. | `default` | -| Other | [`k8s.namespace.annotation.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The annotation placed on the Namespace, the `` being the annotation name, the value being the annotation value, even if the value is empty. [1] | `0`; `` | -| Other | [`k8s.namespace.label.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The label placed on the Namespace, the `` being the label name, the value being the label value, even if the value is empty. [2] | `default`; `` | - +| Identity | [`k8s.namespace.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the namespace that the pod is running in. | `default` | +| Description | [`k8s.namespace.annotation.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The annotation placed on the Namespace, the `` being the annotation name, the value being the annotation value, even if the value is empty. [1] | `0`; `` | +| Description | [`k8s.namespace.label.`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The label placed on the Namespace, the `` being the label name, the value being the label value, even if the value is empty. [2] | `default`; `` | **[1] `k8s.namespace.annotation.`:** Examples: @@ -225,16 +221,13 @@ to a running container. **Description:** A container in a [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). -> :warning: This entity definition contains attributes without a role. -> Stable Entities MUST NOT have attributes without a defined role. - **Attributes:** | Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | | --- | --- | --- | --- | --- | --- | --- | -| Other | [`k8s.container.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | -| Other | [`k8s.container.restart_count`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | -| Other | [`k8s.container.status.last_terminated_reason`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Last terminated reason of the Container. | `Evicted`; `Error` | +| Identity | [`k8s.container.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | +| Identity | [`k8s.container.restart_count`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | +| Description | [`k8s.container.status.last_terminated_reason`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Last terminated reason of the Container. | `Evicted`; `Error` | diff --git a/model/k8s/entities.yaml b/model/k8s/entities.yaml index c1baeb0c3d..0c423be942 100644 --- a/model/k8s/entities.yaml +++ b/model/k8s/entities.yaml @@ -35,12 +35,14 @@ groups: name: k8s.namespace brief: > A Kubernetes Namespace. - # TODO: define attributes roles attributes: - ref: k8s.namespace.name + role: identifying - ref: k8s.namespace.label + role: descriptive requirement_level: opt_in - ref: k8s.namespace.annotation + role: descriptive requirement_level: opt_in - id: entity.k8s.pod @@ -67,11 +69,13 @@ groups: name: k8s.container brief: > A container in a [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). - # TODO: define attributes roles attributes: - ref: k8s.container.name + role: identifying - ref: k8s.container.restart_count + role: identifying - ref: k8s.container.status.last_terminated_reason + role: descriptive - id: entity.k8s.replicaset type: entity