diff --git a/.chloggen/replicasets-labels-annotations.yaml b/.chloggen/replicasets-labels-annotations.yaml new file mode 100644 index 000000000..345e4bb1d --- /dev/null +++ b/.chloggen/replicasets-labels-annotations.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: "Introduce semantic conventions for k8s ReplicaSet labels and annotations" + +# 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: [2132] + +# (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/attributes-registry/k8s.md b/docs/attributes-registry/k8s.md index 63b4075dd..a4281a2eb 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -43,6 +43,8 @@ Kubernetes resource attributes. | `k8s.pod.label.` | string | The label placed on the Pod, the `` being the label name, the value being the label value. [12] | `my-app`; `x64`; `` | ![Development](https://img.shields.io/badge/-development-blue) | | `k8s.pod.name` | string | The name of the Pod. | `opentelemetry-pod-autoconf` | ![Development](https://img.shields.io/badge/-development-blue) | | `k8s.pod.uid` | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Development](https://img.shields.io/badge/-development-blue) | +| `k8s.replicaset.annotation.` | string | The annotation key-value pairs placed on the ReplicaSet. [13] | `k8s.replicaset.annotation.replicas=0`; `k8s.replicaset.annotation.data=` | ![Development](https://img.shields.io/badge/-development-blue) | +| `k8s.replicaset.label.` | string | The label key-value pairs placed on the ReplicaSet. [14] | `k8s.replicaset.label.app=guestbook`; `k8s.replicaset.label.injected=` | ![Development](https://img.shields.io/badge/-development-blue) | | `k8s.replicaset.name` | string | The name of the ReplicaSet. | `opentelemetry` | ![Development](https://img.shields.io/badge/-development-blue) | | `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Development](https://img.shields.io/badge/-development-blue) | | `k8s.replicationcontroller.name` | string | The name of the replication controller. | `opentelemetry` | ![Development](https://img.shields.io/badge/-development-blue) | @@ -134,6 +136,10 @@ conflict. - A label `data` with empty string value SHOULD be recorded as the `k8s.pod.label.data` attribute with value `""`. +**[13] `k8s.replicaset.annotation`:** The `` being the annotation name, the value being the annotation value, even if the value is empty. + +**[14] `k8s.replicaset.label`:** The `` being the label name, the value being the label value, even if the value is empty. + --- `k8s.namespace.phase` 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. diff --git a/docs/resource/k8s.md b/docs/resource/k8s.md index 57e3ee972..693bc43a9 100644 --- a/docs/resource/k8s.md +++ b/docs/resource/k8s.md @@ -243,6 +243,12 @@ to a running container. |---|---|---|---|---|---| | [`k8s.replicaset.name`](/docs/attributes-registry/k8s.md) | string | The name of the ReplicaSet. | `opentelemetry` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | [`k8s.replicaset.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`k8s.replicaset.annotation.`](/docs/attributes-registry/k8s.md) | string | The annotation key-value pairs placed on the ReplicaSet. [1] | `k8s.replicaset.annotation.replicas=0`; `k8s.replicaset.annotation.data=` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`k8s.replicaset.label.`](/docs/attributes-registry/k8s.md) | string | The label key-value pairs placed on the ReplicaSet. [2] | `k8s.replicaset.label.app=guestbook`; `k8s.replicaset.label.injected=` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) | + +**[1] `k8s.replicaset.annotation`:** The `` being the annotation name, the value being the annotation value, even if the value is empty. + +**[2] `k8s.replicaset.label`:** The `` being the label name, the value being the label value, even if the value is empty. diff --git a/model/k8s/registry.yaml b/model/k8s/registry.yaml index b9c535a59..61d5eac8a 100644 --- a/model/k8s/registry.yaml +++ b/model/k8s/registry.yaml @@ -177,6 +177,22 @@ groups: brief: > The name of the ReplicaSet. examples: ['opentelemetry'] + - id: k8s.replicaset.label + type: template[string] + stability: development + brief: > + The label key-value pairs placed on the ReplicaSet. + note: | + The `` being the label name, the value being the label value, even if the value is empty. + examples: ['k8s.replicaset.label.app=guestbook', 'k8s.replicaset.label.injected='] + - id: k8s.replicaset.annotation + type: template[string] + stability: development + brief: > + The annotation key-value pairs placed on the ReplicaSet. + note: | + The `` being the annotation name, the value being the annotation value, even if the value is empty. + examples: [ 'k8s.replicaset.annotation.replicas=0', 'k8s.replicaset.annotation.data=' ] - id: k8s.replicationcontroller.uid type: string stability: development diff --git a/model/k8s/resources.yaml b/model/k8s/resources.yaml index d3466cc6c..0c9b959c2 100644 --- a/model/k8s/resources.yaml +++ b/model/k8s/resources.yaml @@ -70,6 +70,10 @@ groups: attributes: - ref: k8s.replicaset.uid - ref: k8s.replicaset.name + - ref: k8s.replicaset.label + requirement_level: opt_in + - ref: k8s.replicaset.annotation + requirement_level: opt_in - id: resource.k8s.deployment type: resource