Skip to content

Commit

Permalink
add replication_controller metrics
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
  • Loading branch information
ChrsMark committed Dec 3, 2024
1 parent 21d4eaf commit 75863d4
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .chloggen/add_deploy_replica_metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ change_type: enhancement
component: k8s

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add desired and available metrics for k8s deployment and replicaset
note: Add desired and available metrics for k8s deployment, replicaset and replication_controller

# 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.
Expand Down
53 changes: 53 additions & 0 deletions docs/system/k8s-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`.
- [ReplicaSet Metrics](#replicaset-metrics)
- [Metric: `k8s.replicaset.desired`](#metric-k8sreplicasetdesired)
- [Metric: `k8s.replicaset.available`](#metric-k8sreplicasetavailable)
- [ReplicationController Metrics](#replicationcontroller-metrics)
- [Metric: `k8s.replication_controller.desired`](#metric-k8sreplication_controllerdesired)
- [Metric: `k8s.replication_controller.available`](#metric-k8sreplication_controlleravailable)

<!-- tocstop -->

Expand Down Expand Up @@ -464,5 +467,55 @@ This metric is [recommended][MetricRecommended].
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## ReplicationController Metrics

**Description:** ReplicationController level metrics captured under the namespace `k8s.replication_controller`.

### Metric: `k8s.replication_controller.desired`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.k8s.replication_controller.desired -->
<!-- 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.replication_controller.desired` | Gauge | `{pod}` | Number of desired pods in this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** This metric aligns with the `replicas` field of the
[K8s ReplicationController Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core)

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

### Metric: `k8s.replication_controller.available`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.k8s.replication_controller.available -->
<!-- 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.replication_controller.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** This metric aligns with the `availableReplicas` field of the
[K8s ReplicationController Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)

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

[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
22 changes: 22 additions & 0 deletions model/k8s/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,25 @@ groups:
[K8s ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps)
instrument: gauge
unit: "{pod}"

# k8s.replication_controller.* metrics
- id: metric.k8s.replication_controller.desired
type: metric
metric_name: k8s.replication_controller.desired
stability: experimental
brief: "Number of desired pods in this replication controller"
note: |
This metric aligns with the `replicas` field of the
[K8s ReplicationController Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core)
instrument: gauge
unit: "{pod}"
- id: metric.k8s.replication_controller.available
type: metric
metric_name: k8s.replication_controller.available
stability: experimental
brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this replication controller"
note: |
This metric aligns with the `availableReplicas` field of the
[K8s ReplicationController Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)
instrument: gauge
unit: "{pod}"

0 comments on commit 75863d4

Please sign in to comment.