Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hpa, resource_quota, replication_controller k8s attributes #1742

Merged
merged 9 commits into from
Jan 29, 2025
22 changes: 22 additions & 0 deletions .chloggen/add_k8s_resources.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.hpa`, `k8s.resourcequota` and `k8s.replicationcontroller` attributes and resources

# 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: [1656]

# (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:
6 changes: 6 additions & 0 deletions docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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-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 @@ -35,6 +37,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-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
85 changes: 85 additions & 0 deletions docs/resource/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,89 @@ A CronJob creates Jobs on a repeating schedule.
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## ReplicationController

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

<!-- semconv resource.k8s.replicationcontroller -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->


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

**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.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 -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## HorizontalPodAutoscaler

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 -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->


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

**type:** `k8s.hpa`

**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) |

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

## ResourceQuota

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

<!-- semconv resource.k8s.resourcequota -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->


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

**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.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 -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
18 changes: 18 additions & 0 deletions docs/system/k8s-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ This metric is [recommended][MetricRecommended].
**[1]:** This metric aligns with the `replicas` field of the
[K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core)

This metric SHOULD, at a minimum, be reported against a
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand All @@ -547,6 +550,9 @@ This metric is [recommended][MetricRecommended].
**[1]:** This metric aligns with the `availableReplicas` field of the
[K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)

This metric SHOULD, at a minimum, be reported against a
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down Expand Up @@ -682,6 +688,9 @@ This metric is [recommended][MetricRecommended].
**[1]:** This metric aligns with the `desiredReplicas` field of the
[K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand All @@ -705,6 +714,9 @@ This metric is [recommended][MetricRecommended].
**[1]:** This metric aligns with the `currentReplicas` field of the
[K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand All @@ -728,6 +740,9 @@ This metric is [recommended][MetricRecommended].
**[1]:** This metric aligns with the `maxReplicas` field of the
[K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand All @@ -751,6 +766,9 @@ This metric is [recommended][MetricRecommended].
**[1]:** This metric aligns with the `minReplicas` field of the
[K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
18 changes: 18 additions & 0 deletions model/k8s/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ groups:
note: |
This metric aligns with the `replicas` field of the
[K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core)

This metric SHOULD, at a minimum, be reported against a
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
instrument: updowncounter
unit: "{pod}"
- id: metric.k8s.replication_controller.available_pods
Expand All @@ -204,6 +207,9 @@ groups:
note: |
This metric aligns with the `availableReplicas` field of the
[K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)

This metric SHOULD, at a minimum, be reported against a
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
instrument: updowncounter
unit: "{pod}"

Expand Down Expand Up @@ -271,6 +277,9 @@ groups:
note: |
This metric aligns with the `desiredReplicas` field of the
[K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.
instrument: updowncounter
unit: "{pod}"
- id: metric.k8s.hpa.current_pods
Expand All @@ -282,6 +291,9 @@ groups:
note: |
This metric aligns with the `currentReplicas` field of the
[K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.
instrument: updowncounter
unit: "{pod}"
- id: metric.k8s.hpa.max_pods
Expand All @@ -293,6 +305,9 @@ groups:
note: |
This metric aligns with the `maxReplicas` field of the
[K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.
instrument: updowncounter
unit: "{pod}"
- id: metric.k8s.hpa.min_pods
Expand All @@ -304,6 +319,9 @@ groups:
note: |
This metric aligns with the `minReplicas` field of the
[K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling)

This metric SHOULD, at a minimum, be reported against a
[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource.
instrument: updowncounter
unit: "{pod}"

Expand Down
36 changes: 36 additions & 0 deletions model/k8s/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,30 @@ groups:
brief: >
The name of the ReplicaSet.
examples: ['opentelemetry']
- id: k8s.replicationcontroller.uid
type: string
stability: experimental
brief: >
The UID of the replication controller.
examples: [ '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' ]
- id: k8s.replicationcontroller.name
type: string
stability: experimental
brief: >
The name of the replication controller.
examples: [ 'opentelemetry' ]
- id: k8s.resourcequota.uid
type: string
stability: experimental
brief: >
The UID of the resource quota.
examples: [ '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' ]
- id: k8s.resourcequota.name
type: string
stability: experimental
brief: >
The name of the resource quota.
examples: [ 'opentelemetry' ]
- id: k8s.deployment.uid
type: string
stability: experimental
Expand Down Expand Up @@ -153,6 +177,18 @@ groups:
brief: >
The name of the DaemonSet.
examples: ['opentelemetry']
- id: k8s.hpa.uid
type: string
stability: experimental
brief: >
The UID of the horizontal pod autoscaler.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: k8s.hpa.name
type: string
stability: experimental
brief: >
The name of the horizontal pod autoscaler.
examples: ['opentelemetry']
- id: k8s.job.uid
type: string
stability: experimental
Expand Down
30 changes: 30 additions & 0 deletions model/k8s/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,33 @@ groups:
attributes:
- ref: k8s.cronjob.uid
- ref: k8s.cronjob.name

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

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

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