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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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

@ChrsMark ChrsMark requested review from a team as code owners December 10, 2024 12:29
model/k8s/registry.yaml Outdated Show resolved Hide resolved
Signed-off-by: ChrsMark <[email protected]>
stability: experimental
brief: "Operational status: `1` (true) or `0` (false) for each of the possible phases"
instrument: updowncounter
unit: "1"
Copy link
Contributor

@povilasv povilasv Dec 17, 2024

Choose a reason for hiding this comment

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

Shouldn't this be empty unit?

"1" is for utilization:

Instruments for utilization metrics (that measure the fraction out of a total) are dimensionless and SHOULD use the default unit 1 (the unity).

Ref: https://opentelemetry.io/docs/specs/semconv/general/metrics/#instrument-units

Copy link
Member Author

Choose a reason for hiding this comment

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

I followed what

- id: metric.hw.status
type: metric
metric_name: hw.status
stability: experimental
brief: "Operational status: `1` (true) or `0` (false) for each of the possible states"
instrument: updowncounter
unit: "1"
extends: metric.hw.attributes
note: >
`hw.status` is currently specified as an *UpDownCounter* but would ideally be represented using a
[*StateSet* as defined in OpenMetrics](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#stateset).
This semantic convention will be updated once *StateSet* is specified in OpenTelemetry. This planned change
is not expected to have any consequence on the way users query their timeseries backend to retrieve the
values of `hw.status` over time.
attributes:
- ref: hw.state
requirement_level: required
defines 🤔 .

@open-telemetry/specs-semconv-maintainers any suggestion here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants