Skip to content

Commit 6626b77

Browse files
committed
add entity_associations
1 parent ee401da commit 6626b77

File tree

2 files changed

+102
-18
lines changed

2 files changed

+102
-18
lines changed

docs/system/k8s-metrics.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,96 @@ This metric SHOULD, at a minimum, be reported against a
872872
<!-- END AUTOGENERATED TEXT -->
873873
<!-- endsemconv -->
874874

875+
<!-- semconv metric.k8s.hpa.metric.target.cpu.value -->
876+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
877+
<!-- see templates/registry/markdown/snippet.md.j2 -->
878+
<!-- prettier-ignore-start -->
879+
<!-- markdownlint-capture -->
880+
<!-- markdownlint-disable -->
881+
882+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
883+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
884+
| `k8s.hpa.metric.target.cpu.value` | Gauge | `{cpu}` | Target value for CPU resource in HPA config. [1] | ![Development](https://img.shields.io/badge/-development-blue) | `k8s.hpa`; `k8s.namespace` |
885+
886+
**[1]:** This metric aligns with the `value` field of the
887+
[K8s HPA MetricTarget](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#metrictarget-v2-autoscaling).
888+
If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
889+
the `k8s.container.name` attribute MUST be set to identify the specific container within the pod to which the metric applies.
890+
891+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
892+
|---|---|---|---|---|---|
893+
| [`k8s.container.name`](/docs/registry/attributes/k8s.md) | 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` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |
894+
| [`k8s.hpa.metric.type`](/docs/registry/attributes/k8s.md) | string | The type of metric source for the horizontal pod autoscaler. [2] | `Resource`; `ContainerResource` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
895+
896+
**[1] `k8s.container.name`:** if and only if k8s.hpa.metric.type is ContainerResource
897+
898+
**[2] `k8s.hpa.metric.type`:** This attribute reflects the `type` field of spec.metrics[] in the HPA.
899+
900+
<!-- markdownlint-restore -->
901+
<!-- prettier-ignore-end -->
902+
<!-- END AUTOGENERATED TEXT -->
903+
<!-- endsemconv -->
904+
905+
<!-- semconv metric.k8s.hpa.metric.target.cpu.average_value -->
906+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
907+
<!-- see templates/registry/markdown/snippet.md.j2 -->
908+
<!-- prettier-ignore-start -->
909+
<!-- markdownlint-capture -->
910+
<!-- markdownlint-disable -->
911+
912+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
913+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
914+
| `k8s.hpa.metric.target.cpu.average_value` | Gauge | `{cpu}` | Target average value for CPU resource in HPA config. [1] | ![Development](https://img.shields.io/badge/-development-blue) | `k8s.hpa`; `k8s.namespace` |
915+
916+
**[1]:** This metric aligns with the `averageValue` field of the
917+
[K8s HPA MetricTarget](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#metrictarget-v2-autoscaling).
918+
If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
919+
the `k8s.container.name` attribute MUST be set to identify the specific container within the pod to which the metric applies.
920+
921+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
922+
|---|---|---|---|---|---|
923+
| [`k8s.container.name`](/docs/registry/attributes/k8s.md) | 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` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |
924+
| [`k8s.hpa.metric.type`](/docs/registry/attributes/k8s.md) | string | The type of metric source for the horizontal pod autoscaler. [2] | `Resource`; `ContainerResource` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
925+
926+
**[1] `k8s.container.name`:** if and only if k8s.hpa.metric.type is ContainerResource
927+
928+
**[2] `k8s.hpa.metric.type`:** This attribute reflects the `type` field of spec.metrics[] in the HPA.
929+
930+
<!-- markdownlint-restore -->
931+
<!-- prettier-ignore-end -->
932+
<!-- END AUTOGENERATED TEXT -->
933+
<!-- endsemconv -->
934+
935+
<!-- semconv metric.k8s.hpa.metric.target.cpu.average_utilization -->
936+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
937+
<!-- see templates/registry/markdown/snippet.md.j2 -->
938+
<!-- prettier-ignore-start -->
939+
<!-- markdownlint-capture -->
940+
<!-- markdownlint-disable -->
941+
942+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
943+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
944+
| `k8s.hpa.metric.target.cpu.average_utilization` | Gauge | `1` | Target average utilization, in percentage, for CPU resource in HPA config. [1] | ![Development](https://img.shields.io/badge/-development-blue) | `k8s.hpa`; `k8s.namespace` |
945+
946+
**[1]:** This metric aligns with the `averageUtilization` field of the
947+
[K8s HPA MetricTarget](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#metrictarget-v2-autoscaling).
948+
If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
949+
the `k8s.container.name` attribute MUST be set to identify the specific container within the pod to which the metric applies.
950+
951+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
952+
|---|---|---|---|---|---|
953+
| [`k8s.container.name`](/docs/registry/attributes/k8s.md) | 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` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |
954+
| [`k8s.hpa.metric.type`](/docs/registry/attributes/k8s.md) | string | The type of metric source for the horizontal pod autoscaler. [2] | `Resource`; `ContainerResource` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
955+
956+
**[1] `k8s.container.name`:** if and only if k8s.hpa.metric.type is ContainerResource.
957+
958+
**[2] `k8s.hpa.metric.type`:** This attribute reflects the `type` field of spec.metrics[] in the HPA.
959+
960+
<!-- markdownlint-restore -->
961+
<!-- prettier-ignore-end -->
962+
<!-- END AUTOGENERATED TEXT -->
963+
<!-- endsemconv -->
964+
875965
## DaemonSet metrics
876966

877967
**Description:** DaemonSet level metrics captured under the namespace `k8s.daemonset`.

model/k8s/metrics.yaml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -354,20 +354,18 @@ groups:
354354
note: |
355355
This metric aligns with the `value` field of the
356356
[K8s HPA MetricTarget](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#metrictarget-v2-autoscaling).
357-
358-
This metric SHOULD be reported against a [`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler)
359-
resource. If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
357+
If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
360358
the `k8s.container.name` attribute MUST be set to identify the specific container within the pod to which the metric applies.
361359
instrument: gauge
362360
unit: "{cpu}"
363361
attributes:
364-
- ref: k8s.hpa.name
365-
- ref: k8s.hpa.uid
366-
- ref: k8s.namespace.name
367362
- ref: k8s.hpa.metric.type
368363
- ref: k8s.container.name
369364
requirement_level:
370365
conditionally_required: if and only if k8s.hpa.metric.type is ContainerResource
366+
entity_associations:
367+
- k8s.hpa
368+
- k8s.namespace
371369
- id: metric.k8s.hpa.metric.target.cpu.average_value
372370
type: metric
373371
metric_name: k8s.hpa.metric.target.cpu.average_value
@@ -376,20 +374,18 @@ groups:
376374
note: |
377375
This metric aligns with the `averageValue` field of the
378376
[K8s HPA MetricTarget](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#metrictarget-v2-autoscaling).
379-
380-
This metric SHOULD be reported against a [`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler)
381-
resource. If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
377+
If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
382378
the `k8s.container.name` attribute MUST be set to identify the specific container within the pod to which the metric applies.
383379
instrument: gauge
384380
unit: "{cpu}"
385381
attributes:
386-
- ref: k8s.hpa.name
387-
- ref: k8s.hpa.uid
388-
- ref: k8s.namespace.name
389382
- ref: k8s.hpa.metric.type
390383
- ref: k8s.container.name
391384
requirement_level:
392385
conditionally_required: if and only if k8s.hpa.metric.type is ContainerResource
386+
entity_associations:
387+
- k8s.hpa
388+
- k8s.namespace
393389
- id: metric.k8s.hpa.metric.target.cpu.average_utilization
394390
type: metric
395391
metric_name: k8s.hpa.metric.target.cpu.average_utilization
@@ -398,20 +394,18 @@ groups:
398394
note: |
399395
This metric aligns with the `averageUtilization` field of the
400396
[K8s HPA MetricTarget](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#metrictarget-v2-autoscaling).
401-
402-
This metric SHOULD be reported against a [`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler)
403-
resource. If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
397+
If the type of the metric is [`ContainerResource`](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis),
404398
the `k8s.container.name` attribute MUST be set to identify the specific container within the pod to which the metric applies.
405399
instrument: gauge
406400
unit: "1"
407401
attributes:
408-
- ref: k8s.hpa.name
409-
- ref: k8s.hpa.uid
410-
- ref: k8s.namespace.name
411402
- ref: k8s.hpa.metric.type
412403
- ref: k8s.container.name
413404
requirement_level:
414405
conditionally_required: if and only if k8s.hpa.metric.type is ContainerResource.
406+
entity_associations:
407+
- k8s.hpa
408+
- k8s.namespace
415409

416410
# k8s.daemonset.* metrics
417411
- id: metric.k8s.daemonset.current_scheduled_nodes

0 commit comments

Comments
 (0)