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 k8s.namespace.phase metric and attribute #1668

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Dec 10, 2024

Part of #1032

Changes

This PR adds the k8s.namespace.phase as metric along with its respective attribute k8s.namespace.phase.

This metric is already in use by the Collector and specifically the k8scluster receiver.

The introduced attribute is new in order to follow the modeling that is already in use by hw metrics and jmx metrics mentioned at #1032 (comment) (see #1554).

Collector implementation: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/9dfa2f7813b11500d001622f3d8c1dd8d9ac58fd/receiver/k8sclusterreceiver/internal/namespace/namespaces.go#L14

K8s API ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core

Merge requirement checklist

model/k8s/registry.yaml Outdated Show resolved Hide resolved
model/k8s/metrics.yaml Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Jan 2, 2025

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added Stale and removed Stale labels Jan 2, 2025
@ChrsMark ChrsMark force-pushed the add_k8s_ns_phase branch 3 times, most recently from 2eb9c03 to c50df58 Compare January 9, 2025 08:50
@ChrsMark ChrsMark requested review from lmolkova and povilasv January 13, 2025 08:53
@ChrsMark ChrsMark self-assigned this Jan 14, 2025
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is "phase" a common term in the context of k8s namespaces? (i.e. vs status or state)

@ChrsMark
Copy link
Member Author

is "phase" a common term in the context of k8s namespaces? (i.e. vs status or state)

I believe so. It's what the API defines and I see it's used in the docs description as well:

A namespace can be in one of two phases:

- Active the namespace is in use
- Terminating the namespace is being deleted, and can not be used for new objects

model/k8s/registry.yaml Outdated Show resolved Hide resolved
model/k8s/metrics.yaml Show resolved Hide resolved
model/k8s/metrics.yaml Outdated Show resolved Hide resolved
model/k8s/registry.yaml Outdated Show resolved Hide resolved
@AlexanderWert AlexanderWert merged commit c828beb into open-telemetry:main Jan 21, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants