Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions receiver/kubeletstatsreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
The Kubelet Stats Receiver pulls node, pod, container, and volume metrics from the API server on a kubelet
and sends it down the metric pipeline for further processing.

> [!WARNING]
> The `receiver.kubeletstats.enableCPUUsageMetrics` feature gate was moved to stage `Stable`.
> Deprecated metrics cannot be used anymore.
> For more information which metrics are affected see [here](#metrics-deprecation).

## Metrics

Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) with further documentation in [documentation.md](./documentation.md)
Expand Down Expand Up @@ -332,24 +327,3 @@ rules:
resources: ["nodes/proxy"]
verbs: ["get"]
```

### Metrics deprecation

The following metrics were deprecated and renamed from version `v0.125.0`:

- `k8s.node.cpu.utilization` (renamed to `k8s.node.cpu.usage`)
- `k8s.pod.cpu.utilization` (renamed to `k8s.pod.cpu.usage`)
- `container.cpu.utilization` (renamed to `container.cpu.usage`)

The above metrics show usage counted in CPUs and it's not a percentage of used resources.
These metrics were previously incorrectly named using the utilization term.

#### `receiver.kubeletstats.enableCPUUsageMetrics` feature gate

- alpha: when enabled it makes the `.cpu.usage` metrics enabled by default, disabling the `.cpu.utilization` metrics
- beta: `.cpu.usage` metrics are enabled by default and any configuration enabling the deprecated `.cpu.utilization` metrics will be failing. Explicitly disabling the feature gate provides the old (deprecated) behavior.
- stable: `.cpu.usage` metrics are enabled by default and the deprecated metrics are completely removed.
- removed three releases after stable.

More information about the deprecation plan and
the background reasoning can be found at <https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27885>.
24 changes: 0 additions & 24 deletions receiver/kubeletstatsreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,6 @@ metrics:
enabled: true
```

### container.cpu.utilization

Container CPU utilization

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Double |

### container.uptime

The time since the container started
Expand Down Expand Up @@ -450,14 +442,6 @@ Container memory utilization as a ratio of the container's requests
| ---- | ----------- | ---------- |
| 1 | Gauge | Double |

### k8s.node.cpu.utilization

Node CPU utilization

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Double |

### k8s.node.uptime

The time since the node started
Expand All @@ -474,14 +458,6 @@ Pod cpu utilization as a ratio of the node's capacity
| ---- | ----------- | ---------- |
| 1 | Gauge | Double |

### k8s.pod.cpu.utilization

Pod CPU utilization

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Double |

### k8s.pod.cpu_limit_utilization

Pod cpu utilization as a ratio of the pod's total container limits. If any container is missing a limit the metric is not emitted.
Expand Down
13 changes: 1 addition & 12 deletions receiver/kubeletstatsreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/featuregate"
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/collector/scraper/scraperhelper"
"go.uber.org/zap"
Expand All @@ -21,17 +20,7 @@ import (
)

const (
metricGroupsConfig = "metric_groups"
enableCPUUsageMetricsFeatureFlag = "receiver.kubeletstats.enableCPUUsageMetrics"
)

var EnableCPUUsageMetrics = featuregate.GlobalRegistry().MustRegister(
enableCPUUsageMetricsFeatureFlag,
featuregate.StageStable,
featuregate.WithRegisterDescription("When enabled the container.cpu.utilization, k8s.pod.cpu.utilization and k8s.node.cpu.utilization metrics will be replaced by the container.cpu.usage, k8s.pod.cpu.usage and k8s.node.cpu.usage"),
featuregate.WithRegisterFromVersion("v0.110.0"),
featuregate.WithRegisterToVersion("v0.131.0"),
featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27885"),
metricGroupsConfig = "metric_groups"
)

var defaultMetricGroups = []kubelet.MetricGroup{
Expand Down
2 changes: 1 addition & 1 deletion receiver/kubeletstatsreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ require (
go.opentelemetry.io/collector/confmap/xconfmap v0.135.1-0.20250911155607-37a3ace6274c
go.opentelemetry.io/collector/consumer v1.41.1-0.20250911155607-37a3ace6274c
go.opentelemetry.io/collector/consumer/consumertest v0.135.1-0.20250911155607-37a3ace6274c
go.opentelemetry.io/collector/featuregate v1.41.1-0.20250911155607-37a3ace6274c
go.opentelemetry.io/collector/filter v0.135.1-0.20250911155607-37a3ace6274c
go.opentelemetry.io/collector/pdata v1.41.1-0.20250911155607-37a3ace6274c
go.opentelemetry.io/collector/pipeline v1.41.1-0.20250911155607-37a3ace6274c
Expand Down Expand Up @@ -110,6 +109,7 @@ require (
go.opentelemetry.io/collector/consumer/xconsumer v0.135.1-0.20250911155607-37a3ace6274c // indirect
go.opentelemetry.io/collector/extension/extensionauth v1.41.1-0.20250911155607-37a3ace6274c // indirect
go.opentelemetry.io/collector/extension/extensionmiddleware v0.135.1-0.20250911155607-37a3ace6274c // indirect
go.opentelemetry.io/collector/featuregate v1.41.1-0.20250911155607-37a3ace6274c // indirect
go.opentelemetry.io/collector/internal/sharedcomponent v0.135.1-0.20250911155607-37a3ace6274c // indirect
go.opentelemetry.io/collector/internal/telemetry v0.135.1-0.20250911155607-37a3ace6274c // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.135.1-0.20250911155607-37a3ace6274c // indirect
Expand Down
2 changes: 0 additions & 2 deletions receiver/kubeletstatsreceiver/internal/kubelet/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ func addCPUUtilizationMetrics(
r resources,
nodeCPULimit float64,
) {
cpuMetrics.Utilization(mb, currentTime, usageCores)

if nodeCPULimit > 0 {
cpuMetrics.NodeUtilization(mb, currentTime, usageCores/nodeCPULimit)
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading