Skip to content

Commit

Permalink
follow k8s api naming
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
  • Loading branch information
ChrsMark committed Jan 24, 2025
1 parent c90ce8d commit 595f157
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 63 deletions.
12 changes: 6 additions & 6 deletions docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Kubernetes resource attributes.
| <a id="k8s-daemonset-uid" href="#k8s-daemonset-uid">`k8s.daemonset.uid`</a> | string | The UID of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-deployment-name" href="#k8s-deployment-name">`k8s.deployment.name`</a> | string | The name of the Deployment. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-deployment-uid" href="#k8s-deployment-uid">`k8s.deployment.uid`</a> | string | The UID of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-hpa-name" href="#k8s-hpa-name">`k8s.hpa.name`</a> | string | The name of the horizontal pod autoscaler. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-hpa-uid" href="#k8s-hpa-uid">`k8s.hpa.uid`</a> | string | The UID of the horizontal pod autoscaler. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-horizontalpodautoscaler-name" href="#k8s-horizontalpodautoscaler-name">`k8s.horizontalpodautoscaler.name`</a> | string | The name of the horizontal pod autoscaler. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-horizontalpodautoscaler-uid" href="#k8s-horizontalpodautoscaler-uid">`k8s.horizontalpodautoscaler.uid`</a> | string | The UID of the horizontal pod autoscaler. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-job-name" href="#k8s-job-name">`k8s.job.name`</a> | string | The name of the Job. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-job-uid" href="#k8s-job-uid">`k8s.job.uid`</a> | string | The UID of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-namespace-name" href="#k8s-namespace-name">`k8s.namespace.name`</a> | string | The name of the namespace that the pod is running in. | `default` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand All @@ -40,10 +40,10 @@ Kubernetes resource attributes.
| <a id="k8s-pod-uid" href="#k8s-pod-uid">`k8s.pod.uid`</a> | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-replicaset-name" href="#k8s-replicaset-name">`k8s.replicaset.name`</a> | string | The name of the ReplicaSet. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-replicaset-uid" href="#k8s-replicaset-uid">`k8s.replicaset.uid`</a> | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-replication-controller-name" href="#k8s-replication-controller-name">`k8s.replication_controller.name`</a> | string | The name of the replication controller. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-replication-controller-uid" href="#k8s-replication-controller-uid">`k8s.replication_controller.uid`</a> | string | The UID of the replication controller. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-resource-quota-name" href="#k8s-resource-quota-name">`k8s.resource_quota.name`</a> | string | The name of the resource quota. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-resource-quota-uid" href="#k8s-resource-quota-uid">`k8s.resource_quota.uid`</a> | string | The UID of the resource quota. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-replicationcontroller-name" href="#k8s-replicationcontroller-name">`k8s.replicationcontroller.name`</a> | string | The name of the replication controller. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-replicationcontroller-uid" href="#k8s-replicationcontroller-uid">`k8s.replicationcontroller.uid`</a> | string | The UID of the replication controller. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-resourcequota-name" href="#k8s-resourcequota-name">`k8s.resourcequota.name`</a> | string | The name of the resource quota. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-resourcequota-uid" href="#k8s-resourcequota-uid">`k8s.resourcequota.uid`</a> | string | The UID of the resource quota. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-statefulset-name" href="#k8s-statefulset-name">`k8s.statefulset.name`</a> | string | The name of the StatefulSet. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-statefulset-uid" href="#k8s-statefulset-uid">`k8s.statefulset.uid`</a> | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="k8s-volume-name" href="#k8s-volume-name">`k8s.volume.name`</a> | string | The name of the K8s volume. | `volume0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
34 changes: 7 additions & 27 deletions docs/non-normative/k8s-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ and one for disabling the old schema called `semconv.k8s.disableLegacy`. Then:
- [K8s Job metrics](#k8s-job-metrics)
- [K8s Cronjob metrics](#k8s-cronjob-metrics)
- [K8s Namespace metrics](#k8s-namespace-metrics)
- [K8s ReplicationController attributes](#k8s-replicationcontroller-attributes)
- [K8s ResourceQuota attributes](#k8s-resourcequota-attributes)
- [K8s HorizontalPodAutoscaler attributes](#k8s-horizontalpodautoscaler-attributes)

<!-- tocstop -->

Expand Down Expand Up @@ -256,9 +255,9 @@ The changes in their metrics are the following:

<!-- prettier-ignore-end -->

### K8s ReplicationController attributes
### K8s HorizontalPodAutoscaler attributes

The K8s ReplicationController attributes implemented by the Collector and specifically the
The K8s HorizontalPodAutoscaler attributes 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
[#1649](https://github.com/open-telemetry/semantic-conventions/pull/1742) (TODO: replace with SemConv version once
Expand All @@ -268,28 +267,9 @@ The changes are the following:

<!-- prettier-ignore-start -->

| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New |
|------------------------------------------------------------------------------------|-----------------------------------|
| `k8s.replicationcontroller.name` | `k8s.replication_controller.name` |
| `k8s.replicationcontroller.uid` | `k8s.replication_controller.uid` |

<!-- prettier-ignore-end -->

### K8s ResourceQuota attributes

The K8s ResourceQuota attributes 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
[#1649](https://github.com/open-telemetry/semantic-conventions/pull/1742) (TODO: replace with SemConv version once
available).

The changes are the following:

<!-- prettier-ignore-start -->

| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New |
|----------------------------------------------------------------------------------|-----------------------------------|
| `k8s.resourcequota.name` | `k8s.resource_quota.name` |
| `k8s.resourcequota.uid` | `k8s.resource_quota.uid` |
| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New |
|------------------------------------------------------------------------------------|------------------------------------|
| `k8s.horizontalpodautoscaler.name` | `k8s.horizontalpodautoscaler.name` |
| `k8s.horizontalpodautoscaler.uid` | `k8s.horizontalpodautoscaler.uid` |

<!-- prettier-ignore-end -->
24 changes: 12 additions & 12 deletions docs/resource/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ A CronJob creates Jobs on a repeating schedule.

A ReplicationController ensures that a specified number of pod replicas are running at any one time.

<!-- semconv resource.k8s.replication_controller -->
<!-- semconv resource.k8s.replicationcontroller -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
Expand All @@ -367,14 +367,14 @@ A ReplicationController ensures that a specified number of pod replicas are runn

**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue)

**type:** `k8s.replication_controller`
**type:** `k8s.replicationcontroller`

**Description:** A Kubernetes ReplicationController object.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`k8s.replication_controller.name`](/docs/attributes-registry/k8s.md) | string | The name of the replication controller. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.replication_controller.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the replication controller. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.replicationcontroller.name`](/docs/attributes-registry/k8s.md) | string | The name of the replication controller. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.replicationcontroller.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the replication controller. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Expand All @@ -386,7 +386,7 @@ A ReplicationController ensures that a specified number of pod replicas are runn
A HorizontalPodAutoscaler (HPA for short) automatically updates a workload resource
(such as a Deployment or StatefulSet), with the aim of automatically scaling the workload to match demand.

<!-- semconv resource.k8s.hpa -->
<!-- semconv resource.k8s.horizontalpodautoscaler -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
Expand All @@ -396,14 +396,14 @@ A HorizontalPodAutoscaler (HPA for short) automatically updates a workload resou

**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue)

**type:** `k8s.hpa`
**type:** `k8s.horizontalpodautoscaler`

**Description:** A Kubernetes HorizontalPodAutoscaler object.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`k8s.hpa.name`](/docs/attributes-registry/k8s.md) | string | The name of the horizontal pod autoscaler. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.hpa.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the horizontal pod autoscaler. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.horizontalpodautoscaler.name`](/docs/attributes-registry/k8s.md) | string | The name of the horizontal pod autoscaler. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.horizontalpodautoscaler.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the horizontal pod autoscaler. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Expand All @@ -414,7 +414,7 @@ A HorizontalPodAutoscaler (HPA for short) automatically updates a workload resou

A ResourceQuota provides constraints that limit aggregate resource consumption per namespace.

<!-- semconv resource.k8s.resource_quota -->
<!-- semconv resource.k8s.resourcequota -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
Expand All @@ -424,14 +424,14 @@ A ResourceQuota provides constraints that limit aggregate resource consumption p

**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue)

**type:** `k8s.resource_quota`
**type:** `k8s.resourcequota`

**Description:** A Kubernetes ResourceQuota object.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`k8s.resource_quota.name`](/docs/attributes-registry/k8s.md) | string | The name of the resource quota. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.resource_quota.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the resource quota. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.resourcequota.name`](/docs/attributes-registry/k8s.md) | string | The name of the resource quota. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.resourcequota.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the resource quota. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Expand Down
12 changes: 6 additions & 6 deletions model/k8s/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,25 @@ groups:
brief: >
The name of the ReplicaSet.
examples: ['opentelemetry']
- id: k8s.replication_controller.uid
- id: k8s.replicationcontroller.uid
type: string
stability: experimental
brief: >
The UID of the replication controller.
examples: [ '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' ]
- id: k8s.replication_controller.name
- id: k8s.replicationcontroller.name
type: string
stability: experimental
brief: >
The name of the replication controller.
examples: [ 'opentelemetry' ]
- id: k8s.resource_quota.uid
- id: k8s.resourcequota.uid
type: string
stability: experimental
brief: >
The UID of the resource quota.
examples: [ '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' ]
- id: k8s.resource_quota.name
- id: k8s.resourcequota.name
type: string
stability: experimental
brief: >
Expand Down Expand Up @@ -177,13 +177,13 @@ groups:
brief: >
The name of the DaemonSet.
examples: ['opentelemetry']
- id: k8s.hpa.uid
- id: k8s.horizontalpodautoscaler.uid
type: string
stability: experimental
brief: >
The UID of the horizontal pod autoscaler.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: k8s.hpa.name
- id: k8s.horizontalpodautoscaler.name
type: string
stability: experimental
brief: >
Expand Down
24 changes: 12 additions & 12 deletions model/k8s/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,32 +112,32 @@ groups:
- ref: k8s.cronjob.uid
- ref: k8s.cronjob.name

- id: resource.k8s.replication_controller
- id: resource.k8s.replicationcontroller
type: resource
stability: experimental
name: k8s.replication_controller
name: k8s.replicationcontroller
brief: >
A Kubernetes ReplicationController object.
attributes:
- ref: k8s.replication_controller.uid
- ref: k8s.replication_controller.name
- ref: k8s.replicationcontroller.uid
- ref: k8s.replicationcontroller.name

- id: resource.k8s.hpa
- id: resource.k8s.horizontalpodautoscaler
type: resource
stability: experimental
name: k8s.hpa
name: k8s.horizontalpodautoscaler
brief: >
A Kubernetes HorizontalPodAutoscaler object.
attributes:
- ref: k8s.hpa.uid
- ref: k8s.hpa.name
- ref: k8s.horizontalpodautoscaler.uid
- ref: k8s.horizontalpodautoscaler.name

- id: resource.k8s.resource_quota
- id: resource.k8s.resourcequota
type: resource
stability: experimental
name: k8s.resource_quota
name: k8s.resourcequota
brief: >
A Kubernetes ResourceQuota object.
attributes:
- ref: k8s.resource_quota.uid
- ref: k8s.resource_quota.name
- ref: k8s.resourcequota.uid
- ref: k8s.resourcequota.name

0 comments on commit 595f157

Please sign in to comment.