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

[receiver/kubeletstats] Start name change for cpu.utilization #25901

Conversation

TylerHelmuth
Copy link
Member

@TylerHelmuth TylerHelmuth commented Aug 18, 2023

Description:
Starts the name change processor for *.cpu.utilization metrics.

Link to tracking Issue:
Related to #24905
Related to #27885

Testing:

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

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

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

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

@github-actions
Copy link
Contributor

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

@TylerHelmuth TylerHelmuth force-pushed the kubeletstats-start-changing-cpu-utilization branch from c00544d to 2dfdd5f Compare October 20, 2023 14:12
@povilasv
Copy link
Contributor

Another thing I was thining about, is maybe we can actually compute the CPU utilization somehow?

I.e. instead of deprecating, we actually fix it to correctly report the values?

@TylerHelmuth
Copy link
Member Author

@povilasv good questions, can you ask that question in the issue

Copy link
Contributor

github-actions bot commented Nov 8, 2023

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

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

It's unclear how the new usage metrics are different from time metrics. Can you please clarify that they are average aggregations over time?

@TylerHelmuth
Copy link
Member Author

TylerHelmuth commented Jan 9, 2024

@dmitryax I'm only as knowledgable as the comments on the struct:

// CPUStats contains data about CPU usage.
type CPUStats struct {
	// The time at which these stats were updated.
	Time metav1.Time `json:"time"`
	// Total CPU usage (sum of all cores) averaged over the sample window.
	// The "core" unit can be interpreted as CPU core-nanoseconds per second.
	// +optional
	UsageNanoCores *uint64 `json:"usageNanoCores,omitempty"`
	// Cumulative CPU usage (sum of all cores) since object creation.
	// +optional
	UsageCoreNanoSeconds *uint64 `json:"usageCoreNanoSeconds,omitempty"`
}

We use Time to set the *.cpu.time and we use UsageNanoCores to set *.cpu.utilization (and now *.cpu.usage). @jinja2 @povilasv do you know?

@dmitryax
Copy link
Member

dmitryax commented Jan 9, 2024

I was just asking to improve the description of the "usage" metrics to make it easier to differentiate it from the "time" metrics.

Usage can be described as "Total CPU usage (sum of all cores per second) averaged over the sample window".

Time can be "Total cumulative CPU time (sum of all cores) spent by the container/pod/node since its creation".

@TylerHelmuth @povilasv @jinja2 let me know if it's clear enough

k8s.node.cpu.usage:
enabled: false
description: "Node CPU usage"
unit: s
Copy link
Member

Choose a reason for hiding this comment

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

Not sure unit is s. Maybe {cpu}?

@povilasv
Copy link
Contributor

povilasv commented Jan 10, 2024

Based on my prior research it looks like CpuNanoCores it returns nanoseconds. See #27885 (comment)

And I think that's why we are dividing by 1_000_000_000 to get seconds:

	value := float64(*s.UsageNanoCores) / 1_000_000_000
	cpuMetrics.Utilization(mb, currentTime, value)
	cpuMetrics.Usage(mb, currentTime, value)

I'll recheck and dig around in that code a bit more to try to figure it out what it's actually counting, as those docs are pretty confusing

@dmitryax
Copy link
Member

dmitryax commented Jan 11, 2024

Based on my prior research it looks like CpuNanoCores it returns nanoseconds

It is, but it's an average nanoseconds*cpu/second over a reporting interval. Dividing it by 1_000_000_000 ns should give us {cpu}

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

LGTM. @povilasv PTAL

Copy link
Contributor

@povilasv povilasv left a comment

Choose a reason for hiding this comment

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

LGTM

@dmitryax dmitryax merged commit 74294cb into open-telemetry:main Jan 12, 2024
85 checks passed
@github-actions github-actions bot added this to the next release milestone Jan 12, 2024
@TylerHelmuth TylerHelmuth deleted the kubeletstats-start-changing-cpu-utilization branch January 12, 2024 17:09
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Feb 1, 2024
…elemetry#25901)

**Description:** 
Starts the name change processor for `*.cpu.utilization` metrics. 

**Link to tracking Issue:** 
Related to
open-telemetry#24905
Related to
open-telemetry#27885
dmitryax added a commit to signalfx/splunk-otel-collector that referenced this pull request Feb 7, 2024
The following metrics emitted by kubeletstats receiver were deprecated:
- k8s.node.cpu.utilization
- k8s.pod.cpu.utilization
- container.cpu.utilization

See open-telemetry/opentelemetry-collector-contrib#25901 for more details.

Those metrics are already excluded by default in the signalfx exporter. So if we don't do anything, user will see the following confusing warnings:
```
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
```

Potentially we couldn't just explicitly disable them in the default k8s configuration on the receiver side. The problem is that the exclusion on the signalfx exporter side potentially can be disabled by users. For those users, we actually want to show the warnings.

So we need to add another converter until the metric is disabled on the kubelet receiver side by default. The converter looks at the signalfx exporter in user's config, and if metrics are not explicitly enabled on the exporter side, it disables them on the kubelet receiver side to supress the warnings.

The converted required to copy `dpfilters` package from signal exporter. This will be removed along with the converter in a few releases.
dmitryax added a commit to signalfx/splunk-otel-collector that referenced this pull request Feb 7, 2024
The following metrics emitted by kubeletstats receiver were deprecated:
- k8s.node.cpu.utilization
- k8s.pod.cpu.utilization
- container.cpu.utilization

See open-telemetry/opentelemetry-collector-contrib#25901 for more details.

Those metrics are already excluded by default in the signalfx exporter. So if we don't do anything, user will see the following confusing warnings:
```
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
```

Potentially we couldn't just explicitly disable them in the default k8s configuration on the receiver side. The problem is that the exclusion on the signalfx exporter side potentially can be disabled by users. For those users, we actually want to show the warnings.

So we need to add another converter until the metric is disabled on the kubelet receiver side by default. The converter looks at the signalfx exporter in user's config, and if metrics are not explicitly enabled on the exporter side, it disables them on the kubelet receiver side to supress the warnings.

The converted required to copy `dpfilters` package from signal exporter. This will be removed along with the converter in a few releases.
dmitryax added a commit to signalfx/splunk-otel-collector that referenced this pull request Feb 7, 2024
The following metrics emitted by kubeletstats receiver were deprecated:
- k8s.node.cpu.utilization
- k8s.pod.cpu.utilization
- container.cpu.utilization

See open-telemetry/opentelemetry-collector-contrib#25901 for more details.

Those metrics are already excluded by default in the signalfx exporter. So if we don't do anything, user will see the following confusing warnings:
```
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
```

Potentially we couldn't just explicitly disable them in the default k8s configuration on the receiver side. The problem is that the exclusion on the signalfx exporter side potentially can be disabled by users. For those users, we actually want to show the warnings.

So we need to add another converter until the metric is disabled on the kubelet receiver side by default. The converter looks at the signalfx exporter in user's config, and if metrics are not explicitly enabled on the exporter side, it disables them on the kubelet receiver side to supress the warnings.

The converted required to copy `dpfilters` package from signal exporter. This will be removed along with the converter in a few releases.
dmitryax added a commit to dmitryax/splunk-otel-collector that referenced this pull request Feb 7, 2024
The following metrics emitted by kubeletstats receiver were deprecated:
- k8s.node.cpu.utilization
- k8s.pod.cpu.utilization
- container.cpu.utilization

See open-telemetry/opentelemetry-collector-contrib#25901 for more details.

Those metrics are already excluded by default in the signalfx exporter. So if we don't do anything, user will see the following confusing warnings:
```
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
```

Potentially we couldn't just explicitly disable them in the default k8s configuration on the receiver side. The problem is that the exclusion on the signalfx exporter side potentially can be disabled by users. For those users, we actually want to show the warnings.

So we need to add another converter until the metric is disabled on the kubelet receiver side by default. The converter looks at the signalfx exporter in user's config, and if metrics are not explicitly enabled on the exporter side, it disables them on the kubelet receiver side to supress the warnings.

The converted required to copy `dpfilters` package from signal exporter. This will be removed along with the converter in a few releases.
dmitryax added a commit to signalfx/splunk-otel-collector that referenced this pull request Feb 7, 2024
The following metrics emitted by kubeletstats receiver were deprecated:
- k8s.node.cpu.utilization
- k8s.pod.cpu.utilization
- container.cpu.utilization

See open-telemetry/opentelemetry-collector-contrib#25901 for more details.

Those metrics are already excluded by default in the signalfx exporter. So if we don't do anything, user will see the following confusing warnings:
```
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
```

Potentially we couldn't just explicitly disable them in the default k8s configuration on the receiver side. The problem is that the exclusion on the signalfx exporter side potentially can be disabled by users. For those users, we actually want to show the warnings.

So we need to add another converter until the metric is disabled on the kubelet receiver side by default. The converter looks at the signalfx exporter in user's config, and if metrics are not explicitly enabled on the exporter side, it disables them on the kubelet receiver side to supress the warnings.

The converted required to copy `dpfilters` package from signal exporter. This will be removed along with the converter in a few releases.
dmitryax added a commit to signalfx/splunk-otel-collector that referenced this pull request Feb 7, 2024
The following metrics emitted by kubeletstats receiver were deprecated:
- k8s.node.cpu.utilization
- k8s.pod.cpu.utilization
- container.cpu.utilization

See open-telemetry/opentelemetry-collector-contrib#25901 for more details.

Those metrics are already excluded by default in the signalfx exporter. So if we don't do anything, user will see the following confusing warnings:
```
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
```

Potentially we couldn't just explicitly disable them in the default k8s configuration on the receiver side. The problem is that the exclusion on the signalfx exporter side potentially can be disabled by users. For those users, we actually want to show the warnings.

So we need to add another converter until the metric is disabled on the kubelet receiver side by default. The converter looks at the signalfx exporter in user's config, and if metrics are not explicitly enabled on the exporter side, it disables them on the kubelet receiver side to supress the warnings.

The converted required to copy `dpfilters` package from signal exporter. This will be removed along with the converter in a few releases.
dmitryax added a commit to signalfx/splunk-otel-collector that referenced this pull request Feb 7, 2024
)

The following metrics emitted by kubeletstats receiver were deprecated:
- k8s.node.cpu.utilization
- k8s.pod.cpu.utilization
- container.cpu.utilization

See open-telemetry/opentelemetry-collector-contrib#25901 for more details.

Those metrics are already excluded by default in the signalfx exporter. So if we don't do anything, user will see the following confusing warnings:
```
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.773Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2894	[WARNING] `container.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric container.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2897	[WARNING] `k8s.node.cpu.utilization` should not be enabled: WARNING: This metric will be disabled in a future release. Use metric k8s.node.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
2024-02-06T19:21:44.774Z	warn	metadata/generated_metrics.go:2900	[WARNING] `k8s.pod.cpu.utilization` should not be enabled: This metric will be disabled in a future release. Use metric k8s.pod.cpu.usage instead.	{"kind": "receiver", "name": "kubeletstats", "data_type": "metrics"}
```

Potentially we couldn't just explicitly disable them in the default k8s configuration on the receiver side. The problem is that the exclusion on the signalfx exporter side potentially can be disabled by users. For those users, we actually want to show the warnings.

So we need to add another converter until the metric is disabled on the kubelet receiver side by default. The converter looks at the signalfx exporter in user's config, and if metrics are not explicitly enabled on the exporter side, it disables them on the kubelet receiver side to supress the warnings.

The converted required to copy `dpfilters` package from signal exporter. This will be removed along with the converter in a few releases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
never stale Issues marked with this label will be never staled and automatically removed receiver/kubeletstats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants