-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add k8s.namespace.phase metric and attribute
Signed-off-by: ChrsMark <[email protected]>
- Loading branch information
Showing
5 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.namespace.phase metric along with the respective attribute | ||
|
||
# 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: [1668] | ||
|
||
# (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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ Kubernetes resource attributes. | |
| <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) | | ||
| <a id="k8s-namespace-phase" href="#k8s-namespace-phase">`k8s.namespace.phase`</a> | string | The phase of the K8s namespace. [2] | `active`; `terminating` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
| <a id="k8s-node-name" href="#k8s-node-name">`k8s.node.name`</a> | string | The name of the Node. | `node-1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
| <a id="k8s-node-uid" href="#k8s-node-uid">`k8s.node.uid`</a> | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
| <a id="k8s-pod-annotation" href="#k8s-pod-annotation">`k8s.pod.annotation.<key>`</a> | string | The annotation key-value pairs placed on the Pod, the `<key>` being the annotation name, the value being the annotation value. | `k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets=true`; `k8s.pod.annotation.mycompany.io/arch=x64`; `k8s.pod.annotation.data=` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
|
@@ -65,6 +66,19 @@ Which states: | |
Therefore, UIDs between clusters should be extremely unlikely to | ||
conflict. | ||
|
||
**[2] `k8s.namespace.phase`:** This attribute aligns with the `phase` field of the | ||
[K8s NamespaceStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core) | ||
|
||
--- | ||
|
||
`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. | ||
|
||
| Value | Description | Stability | | ||
|---|---|---| | ||
| `active` | Active namespace phase as described by [K8s API](https://pkg.go.dev/k8s.io/[email protected]/core/v1#NamespacePhase) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
| `terminating` | Terminating namespace phase as described by [K8s API](https://pkg.go.dev/k8s.io/[email protected]/core/v1#NamespacePhase) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
| `unknown` | Unknow phase is set if phase is blank for some reason | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
|
||
--- | ||
|
||
`k8s.volume.type` 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -329,5 +329,42 @@ This metric is [recommended][MetricRecommended]. | |
<!-- END AUTOGENERATED TEXT --> | ||
<!-- endsemconv --> | ||
|
||
### Metric: `k8s.namespace.phase` | ||
|
||
This metric is [recommended][MetricRecommended]. | ||
|
||
<!-- semconv metric.k8s.namespace.phase --> | ||
<!-- 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.namespace.phase` | UpDownCounter | `1` | Operational status: `1` (true) or `0` (false) for each of the possible phases | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
|
||
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | ||
|---|---|---|---|---|---| | ||
| [`k8s.namespace.phase`](/docs/attributes-registry/k8s.md) | string | The phase of the K8s namespace. [1] | `active`; `terminating` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
|
||
**[1] `k8s.namespace.phase`:** This attribute aligns with the `phase` field of the | ||
[K8s NamespaceStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core) | ||
|
||
--- | ||
|
||
`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. | ||
|
||
| Value | Description | Stability | | ||
|---|---|---| | ||
| `active` | Active namespace phase as described by [K8s API](https://pkg.go.dev/k8s.io/[email protected]/core/v1#NamespacePhase) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
| `terminating` | Terminating namespace phase as described by [K8s API](https://pkg.go.dev/k8s.io/[email protected]/core/v1#NamespacePhase) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | ||
| `unknown` | Unknow phase is set if phase is blank for some reason | ![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 | ||
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,3 +214,25 @@ groups: | |
value: 'local' | ||
brief: "A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume" | ||
stability: experimental | ||
- id: k8s.namespace.phase | ||
stability: experimental | ||
brief: > | ||
The phase of the K8s namespace. | ||
note: | | ||
This attribute aligns with the `phase` field of the | ||
[K8s NamespaceStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core) | ||
examples: [ "active", "terminating" ] | ||
type: | ||
members: | ||
- id: active | ||
value: 'active' | ||
brief: "Active namespace phase as described by [K8s API](https://pkg.go.dev/k8s.io/[email protected]/core/v1#NamespacePhase)" | ||
stability: experimental | ||
- id: terminating | ||
value: 'terminating' | ||
brief: "Terminating namespace phase as described by [K8s API](https://pkg.go.dev/k8s.io/[email protected]/core/v1#NamespacePhase)" | ||
stability: experimental | ||
- id: unknown | ||
value: "unknown" | ||
brief: "Unknow phase is set if phase is blank for some reason" | ||
stability: experimental |