From a33b9021422a000ed3feeaa8d522c31f055e7c34 Mon Sep 17 00:00:00 2001 From: Carlos Castro Date: Fri, 2 Jun 2023 07:27:21 +0100 Subject: [PATCH] [receiver/dockerstats] adding renamed cpu_utilization metric (#22823) This change starts the process for deprecating the metric container.cpu.percent in favor of container.cpu.utilization to adhere to semantic convention. At this step introducing the new metric name disabled by default, leaving the old metric enabled --- .chloggen/change_cpu_percentage_naming.yaml | 26 ++++++++ receiver/dockerstatsreceiver/README.md | 34 ++++++++++ receiver/dockerstatsreceiver/documentation.md | 10 ++- .../internal/metadata/generated_config.go | 4 ++ .../metadata/generated_config_test.go | 2 + .../internal/metadata/generated_metrics.go | 65 ++++++++++++++++++- .../metadata/generated_metrics_test.go | 25 ++++++- .../internal/metadata/testdata/config.yaml | 4 ++ receiver/dockerstatsreceiver/metadata.yaml | 12 +++- receiver/dockerstatsreceiver/receiver.go | 1 + .../mock/cgroups_v2/expected_metrics.yaml | 2 +- .../mock/no_pids_stats/expected_metrics.yaml | 2 +- .../mock/pids_stats_max/expected_metrics.yaml | 2 +- .../single_container/expected_metrics.yaml | 2 +- .../mock/two_containers/expected_metrics.yaml | 4 +- 15 files changed, 185 insertions(+), 10 deletions(-) create mode 100755 .chloggen/change_cpu_percentage_naming.yaml diff --git a/.chloggen/change_cpu_percentage_naming.yaml b/.chloggen/change_cpu_percentage_naming.yaml new file mode 100755 index 000000000000..accd9e02162b --- /dev/null +++ b/.chloggen/change_cpu_percentage_naming.yaml @@ -0,0 +1,26 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# 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: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: dockerstatsreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "cpu.container.percent metric will be deprecated in v0.79.0 in favor of container.cpu.utilization" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [21807] + +# (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 starts the process of phasing out incorrect metric name: + - `container.cpu.utilization` + and replacing it with the names adhering to the semantic conventions: + - `container.cpu.percent` + At this stage, the new metric is added, but is disabled by default. + See the "Deprecations" section of the Docker Stats receiver's README for details. diff --git a/receiver/dockerstatsreceiver/README.md b/receiver/dockerstatsreceiver/README.md index a407460f2062..bcc5c77d0610 100644 --- a/receiver/dockerstatsreceiver/README.md +++ b/receiver/dockerstatsreceiver/README.md @@ -70,6 +70,40 @@ receivers: The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). +## Deprecations + +### Transition to cpu utilization metric name aligned with OpenTelemetry specification + +The Docker Stats receiver has been emitting the following cpu memory metric: + +- [container.cpu.percent] for the percentage of CPU used by the container, + +This is in conflict with the OpenTelemetry specification, +which defines [container.cpu.utilization] as the name for this metric. + +To align the emitted metric names with the OpenTelemetry specification, +the following process will be followed to phase out the old metrics: + +- Between `v0.79.0` and `v0.81.0`, the new metric is introduced and the old metric is marked as deprecated. + Only the old metric are emitted by default. +- Between `v0.82.0` and `v0.84.0`, the old metric is disabled and the new one enabled by default. +- In `v0.85.0` and up, the old metric is removed. + +To change the enabled state for the specific metrics, use the standard configuration options that are available for all metrics. + +Here's an example configuration to disable the old metrics and enable the new metrics: + +```yaml +receivers: + docker_stats: + metrics: + container.cpu.percent: + enabled: false + container.cpu.utilization: + enabled: true + +``` + ### Migrating from ScraperV1 to ScraperV2 *Note: These changes are now in effect and ScraperV1 have been removed as of v0.71.* diff --git a/receiver/dockerstatsreceiver/documentation.md b/receiver/dockerstatsreceiver/documentation.md index 8ad7004003d7..8a6f863e4a2c 100644 --- a/receiver/dockerstatsreceiver/documentation.md +++ b/receiver/dockerstatsreceiver/documentation.md @@ -32,7 +32,7 @@ Number of bytes transferred to/from the disk by the group and descendant groups. ### container.cpu.percent -Percent of CPU used by the container. +Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container. | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | @@ -334,6 +334,14 @@ Note this is the usage for the system, not the container. | ---- | ----------- | ---------- | ----------------------- | --------- | | ns | Sum | Int | Cumulative | true | +### container.cpu.utilization + +Percent of CPU used by the container. + +| Unit | Metric Type | Value Type | +| ---- | ----------- | ---------- | +| 1 | Gauge | Double | + ### container.memory.active_anon The amount of anonymous memory that has been identified as active by the kernel. diff --git a/receiver/dockerstatsreceiver/internal/metadata/generated_config.go b/receiver/dockerstatsreceiver/internal/metadata/generated_config.go index 649a1bc971d5..4a2dd713eb50 100644 --- a/receiver/dockerstatsreceiver/internal/metadata/generated_config.go +++ b/receiver/dockerstatsreceiver/internal/metadata/generated_config.go @@ -42,6 +42,7 @@ type MetricsConfig struct { ContainerCPUUsageSystem MetricConfig `mapstructure:"container.cpu.usage.system"` ContainerCPUUsageTotal MetricConfig `mapstructure:"container.cpu.usage.total"` ContainerCPUUsageUsermode MetricConfig `mapstructure:"container.cpu.usage.usermode"` + ContainerCPUUtilization MetricConfig `mapstructure:"container.cpu.utilization"` ContainerMemoryActiveAnon MetricConfig `mapstructure:"container.memory.active_anon"` ContainerMemoryActiveFile MetricConfig `mapstructure:"container.memory.active_file"` ContainerMemoryCache MetricConfig `mapstructure:"container.memory.cache"` @@ -143,6 +144,9 @@ func DefaultMetricsConfig() MetricsConfig { ContainerCPUUsageUsermode: MetricConfig{ Enabled: true, }, + ContainerCPUUtilization: MetricConfig{ + Enabled: false, + }, ContainerMemoryActiveAnon: MetricConfig{ Enabled: false, }, diff --git a/receiver/dockerstatsreceiver/internal/metadata/generated_config_test.go b/receiver/dockerstatsreceiver/internal/metadata/generated_config_test.go index 39d283209cd4..fd676b7be8ad 100644 --- a/receiver/dockerstatsreceiver/internal/metadata/generated_config_test.go +++ b/receiver/dockerstatsreceiver/internal/metadata/generated_config_test.go @@ -43,6 +43,7 @@ func TestMetricsBuilderConfig(t *testing.T) { ContainerCPUUsageSystem: MetricConfig{Enabled: true}, ContainerCPUUsageTotal: MetricConfig{Enabled: true}, ContainerCPUUsageUsermode: MetricConfig{Enabled: true}, + ContainerCPUUtilization: MetricConfig{Enabled: true}, ContainerMemoryActiveAnon: MetricConfig{Enabled: true}, ContainerMemoryActiveFile: MetricConfig{Enabled: true}, ContainerMemoryCache: MetricConfig{Enabled: true}, @@ -120,6 +121,7 @@ func TestMetricsBuilderConfig(t *testing.T) { ContainerCPUUsageSystem: MetricConfig{Enabled: false}, ContainerCPUUsageTotal: MetricConfig{Enabled: false}, ContainerCPUUsageUsermode: MetricConfig{Enabled: false}, + ContainerCPUUtilization: MetricConfig{Enabled: false}, ContainerMemoryActiveAnon: MetricConfig{Enabled: false}, ContainerMemoryActiveFile: MetricConfig{Enabled: false}, ContainerMemoryCache: MetricConfig{Enabled: false}, diff --git a/receiver/dockerstatsreceiver/internal/metadata/generated_metrics.go b/receiver/dockerstatsreceiver/internal/metadata/generated_metrics.go index 5602c532ce0f..dd4f00719f82 100644 --- a/receiver/dockerstatsreceiver/internal/metadata/generated_metrics.go +++ b/receiver/dockerstatsreceiver/internal/metadata/generated_metrics.go @@ -461,7 +461,7 @@ type metricContainerCPUPercent struct { // init fills container.cpu.percent metric with initial data. func (m *metricContainerCPUPercent) init() { m.data.SetName("container.cpu.percent") - m.data.SetDescription("Percent of CPU used by the container.") + m.data.SetDescription("Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.") m.data.SetUnit("1") m.data.SetEmptyGauge() } @@ -911,6 +911,55 @@ func newMetricContainerCPUUsageUsermode(cfg MetricConfig) metricContainerCPUUsag return m } +type metricContainerCPUUtilization struct { + data pmetric.Metric // data buffer for generated metric. + config MetricConfig // metric config provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills container.cpu.utilization metric with initial data. +func (m *metricContainerCPUUtilization) init() { + m.data.SetName("container.cpu.utilization") + m.data.SetDescription("Percent of CPU used by the container.") + m.data.SetUnit("1") + m.data.SetEmptyGauge() +} + +func (m *metricContainerCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) { + if !m.config.Enabled { + return + } + dp := m.data.Gauge().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetDoubleValue(val) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricContainerCPUUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricContainerCPUUtilization) emit(metrics pmetric.MetricSlice) { + if m.config.Enabled && m.data.Gauge().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricContainerCPUUtilization(cfg MetricConfig) metricContainerCPUUtilization { + m := metricContainerCPUUtilization{config: cfg} + if cfg.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + type metricContainerMemoryActiveAnon struct { data pmetric.Metric // data buffer for generated metric. config MetricConfig // metric config provided by user. @@ -3297,6 +3346,7 @@ type MetricsBuilder struct { metricContainerCPUUsageSystem metricContainerCPUUsageSystem metricContainerCPUUsageTotal metricContainerCPUUsageTotal metricContainerCPUUsageUsermode metricContainerCPUUsageUsermode + metricContainerCPUUtilization metricContainerCPUUtilization metricContainerMemoryActiveAnon metricContainerMemoryActiveAnon metricContainerMemoryActiveFile metricContainerMemoryActiveFile metricContainerMemoryCache metricContainerMemoryCache @@ -3356,6 +3406,12 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { } func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder { + if mbc.Metrics.ContainerCPUPercent.Enabled { + settings.Logger.Warn("[WARNING] `container.cpu.percent` should not be enabled: This metric will be disabled in v0.82.0 and removed in v0.85.0.") + } + if !mbc.Metrics.ContainerCPUUtilization.enabledSetByUser { + settings.Logger.Warn("[WARNING] Please set `enabled` field explicitly for `container.cpu.utilization`: This metric will be enabled by default in v0.82.0.") + } mb := &MetricsBuilder{ startTime: pcommon.NewTimestampFromTime(time.Now()), metricsBuffer: pmetric.NewMetrics(), @@ -3378,6 +3434,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSetting metricContainerCPUUsageSystem: newMetricContainerCPUUsageSystem(mbc.Metrics.ContainerCPUUsageSystem), metricContainerCPUUsageTotal: newMetricContainerCPUUsageTotal(mbc.Metrics.ContainerCPUUsageTotal), metricContainerCPUUsageUsermode: newMetricContainerCPUUsageUsermode(mbc.Metrics.ContainerCPUUsageUsermode), + metricContainerCPUUtilization: newMetricContainerCPUUtilization(mbc.Metrics.ContainerCPUUtilization), metricContainerMemoryActiveAnon: newMetricContainerMemoryActiveAnon(mbc.Metrics.ContainerMemoryActiveAnon), metricContainerMemoryActiveFile: newMetricContainerMemoryActiveFile(mbc.Metrics.ContainerMemoryActiveFile), metricContainerMemoryCache: newMetricContainerMemoryCache(mbc.Metrics.ContainerMemoryCache), @@ -3539,6 +3596,7 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { mb.metricContainerCPUUsageSystem.emit(ils.Metrics()) mb.metricContainerCPUUsageTotal.emit(ils.Metrics()) mb.metricContainerCPUUsageUsermode.emit(ils.Metrics()) + mb.metricContainerCPUUtilization.emit(ils.Metrics()) mb.metricContainerMemoryActiveAnon.emit(ils.Metrics()) mb.metricContainerMemoryActiveFile.emit(ils.Metrics()) mb.metricContainerMemoryCache.emit(ils.Metrics()) @@ -3690,6 +3748,11 @@ func (mb *MetricsBuilder) RecordContainerCPUUsageUsermodeDataPoint(ts pcommon.Ti mb.metricContainerCPUUsageUsermode.recordDataPoint(mb.startTime, ts, val) } +// RecordContainerCPUUtilizationDataPoint adds a data point to container.cpu.utilization metric. +func (mb *MetricsBuilder) RecordContainerCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64) { + mb.metricContainerCPUUtilization.recordDataPoint(mb.startTime, ts, val) +} + // RecordContainerMemoryActiveAnonDataPoint adds a data point to container.memory.active_anon metric. func (mb *MetricsBuilder) RecordContainerMemoryActiveAnonDataPoint(ts pcommon.Timestamp, val int64) { mb.metricContainerMemoryActiveAnon.recordDataPoint(mb.startTime, ts, val) diff --git a/receiver/dockerstatsreceiver/internal/metadata/generated_metrics_test.go b/receiver/dockerstatsreceiver/internal/metadata/generated_metrics_test.go index c0fd9701acc1..957d8f66a648 100644 --- a/receiver/dockerstatsreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/dockerstatsreceiver/internal/metadata/generated_metrics_test.go @@ -49,6 +49,14 @@ func TestMetricsBuilder(t *testing.T) { mb := NewMetricsBuilder(loadMetricsBuilderConfig(t, test.name), settings, WithStartTime(start)) expectedWarnings := 0 + if test.configSet == testSetDefault || test.configSet == testSetAll { + assert.Equal(t, "[WARNING] `container.cpu.percent` should not be enabled: This metric will be disabled in v0.82.0 and removed in v0.85.0.", observedLogs.All()[expectedWarnings].Message) + expectedWarnings++ + } + if test.configSet == testSetDefault { + assert.Equal(t, "[WARNING] Please set `enabled` field explicitly for `container.cpu.utilization`: This metric will be enabled by default in v0.82.0.", observedLogs.All()[expectedWarnings].Message) + expectedWarnings++ + } assert.Equal(t, expectedWarnings, observedLogs.Len()) defaultMetricsCount := 0 @@ -110,6 +118,9 @@ func TestMetricsBuilder(t *testing.T) { allMetricsCount++ mb.RecordContainerCPUUsageUsermodeDataPoint(ts, 1) + allMetricsCount++ + mb.RecordContainerCPUUtilizationDataPoint(ts, 1) + allMetricsCount++ mb.RecordContainerMemoryActiveAnonDataPoint(ts, 1) @@ -505,7 +516,7 @@ func TestMetricsBuilder(t *testing.T) { validatedMetrics["container.cpu.percent"] = true assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) - assert.Equal(t, "Percent of CPU used by the container.", ms.At(i).Description()) + assert.Equal(t, "Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.", ms.At(i).Description()) assert.Equal(t, "1", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) @@ -627,6 +638,18 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, ts, dp.Timestamp()) assert.Equal(t, pmetric.NumberDataPointValueTypeInt, dp.ValueType()) assert.Equal(t, int64(1), dp.IntValue()) + case "container.cpu.utilization": + assert.False(t, validatedMetrics["container.cpu.utilization"], "Found a duplicate in the metrics slice: container.cpu.utilization") + validatedMetrics["container.cpu.utilization"] = true + assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) + assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) + assert.Equal(t, "Percent of CPU used by the container.", ms.At(i).Description()) + assert.Equal(t, "1", ms.At(i).Unit()) + dp := ms.At(i).Gauge().DataPoints().At(0) + assert.Equal(t, start, dp.StartTimestamp()) + assert.Equal(t, ts, dp.Timestamp()) + assert.Equal(t, pmetric.NumberDataPointValueTypeDouble, dp.ValueType()) + assert.Equal(t, float64(1), dp.DoubleValue()) case "container.memory.active_anon": assert.False(t, validatedMetrics["container.memory.active_anon"], "Found a duplicate in the metrics slice: container.memory.active_anon") validatedMetrics["container.memory.active_anon"] = true diff --git a/receiver/dockerstatsreceiver/internal/metadata/testdata/config.yaml b/receiver/dockerstatsreceiver/internal/metadata/testdata/config.yaml index bd96efeb277b..6ed548cf19b3 100644 --- a/receiver/dockerstatsreceiver/internal/metadata/testdata/config.yaml +++ b/receiver/dockerstatsreceiver/internal/metadata/testdata/config.yaml @@ -35,6 +35,8 @@ all_set: enabled: true container.cpu.usage.usermode: enabled: true + container.cpu.utilization: + enabled: true container.memory.active_anon: enabled: true container.memory.active_file: @@ -174,6 +176,8 @@ none_set: enabled: false container.cpu.usage.usermode: enabled: false + container.cpu.utilization: + enabled: false container.memory.active_anon: enabled: false container.memory.active_file: diff --git a/receiver/dockerstatsreceiver/metadata.yaml b/receiver/dockerstatsreceiver/metadata.yaml index 7d608c47cc2a..9929ffce23c5 100644 --- a/receiver/dockerstatsreceiver/metadata.yaml +++ b/receiver/dockerstatsreceiver/metadata.yaml @@ -121,10 +121,20 @@ metrics: value_type: int monotonic: true aggregation: cumulative + container.cpu.utilization: + enabled: false + description: "Percent of CPU used by the container." + unit: "1" + warnings: + if_enabled_not_set: This metric will be enabled by default in v0.82.0. + gauge: + value_type: double container.cpu.percent: enabled: true - description: "Percent of CPU used by the container." + description: "Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container." unit: "1" + warnings: + if_enabled: This metric will be disabled in v0.82.0 and removed in v0.85.0. gauge: value_type: double diff --git a/receiver/dockerstatsreceiver/receiver.go b/receiver/dockerstatsreceiver/receiver.go index 01e22652b577..4d2bbc895e2f 100644 --- a/receiver/dockerstatsreceiver/receiver.go +++ b/receiver/dockerstatsreceiver/receiver.go @@ -248,6 +248,7 @@ func (r *receiver) recordCPUMetrics(now pcommon.Timestamp, cpuStats *dtypes.CPUS r.mb.RecordContainerCPUThrottlingDataThrottledPeriodsDataPoint(now, int64(cpuStats.ThrottlingData.ThrottledPeriods)) r.mb.RecordContainerCPUThrottlingDataPeriodsDataPoint(now, int64(cpuStats.ThrottlingData.Periods)) r.mb.RecordContainerCPUThrottlingDataThrottledTimeDataPoint(now, int64(cpuStats.ThrottlingData.ThrottledTime)) + r.mb.RecordContainerCPUUtilizationDataPoint(now, calculateCPUPercent(prevStats, cpuStats)) r.mb.RecordContainerCPUPercentDataPoint(now, calculateCPUPercent(prevStats, cpuStats)) for coreNum, v := range cpuStats.CPUUsage.PercpuUsage { diff --git a/receiver/dockerstatsreceiver/testdata/mock/cgroups_v2/expected_metrics.yaml b/receiver/dockerstatsreceiver/testdata/mock/cgroups_v2/expected_metrics.yaml index cd809e57d278..91e22ab4586a 100644 --- a/receiver/dockerstatsreceiver/testdata/mock/cgroups_v2/expected_metrics.yaml +++ b/receiver/dockerstatsreceiver/testdata/mock/cgroups_v2/expected_metrics.yaml @@ -52,7 +52,7 @@ resourceMetrics: timeUnixNano: "1682426015943175000" isMonotonic: true unit: By - - description: Percent of CPU used by the container. + - description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.' gauge: dataPoints: - asDouble: 0.041326615629205886 diff --git a/receiver/dockerstatsreceiver/testdata/mock/no_pids_stats/expected_metrics.yaml b/receiver/dockerstatsreceiver/testdata/mock/no_pids_stats/expected_metrics.yaml index cd7bbc9373ce..333729ddc8a6 100644 --- a/receiver/dockerstatsreceiver/testdata/mock/no_pids_stats/expected_metrics.yaml +++ b/receiver/dockerstatsreceiver/testdata/mock/no_pids_stats/expected_metrics.yaml @@ -195,7 +195,7 @@ resourceMetrics: timeUnixNano: "1683723817613281000" isMonotonic: true unit: '{operations}' - - description: Percent of CPU used by the container. + - description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.' gauge: dataPoints: - asDouble: 0.0002888012543185477 diff --git a/receiver/dockerstatsreceiver/testdata/mock/pids_stats_max/expected_metrics.yaml b/receiver/dockerstatsreceiver/testdata/mock/pids_stats_max/expected_metrics.yaml index 63565ff18cf6..8033c3c57542 100644 --- a/receiver/dockerstatsreceiver/testdata/mock/pids_stats_max/expected_metrics.yaml +++ b/receiver/dockerstatsreceiver/testdata/mock/pids_stats_max/expected_metrics.yaml @@ -104,7 +104,7 @@ resourceMetrics: timeUnixNano: "1683723781130612000" isMonotonic: true unit: By - - description: Percent of CPU used by the container. + - description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.' gauge: dataPoints: - asDouble: 0 diff --git a/receiver/dockerstatsreceiver/testdata/mock/single_container/expected_metrics.yaml b/receiver/dockerstatsreceiver/testdata/mock/single_container/expected_metrics.yaml index dc14d2e8871f..af9abd63e396 100644 --- a/receiver/dockerstatsreceiver/testdata/mock/single_container/expected_metrics.yaml +++ b/receiver/dockerstatsreceiver/testdata/mock/single_container/expected_metrics.yaml @@ -201,7 +201,7 @@ resourceMetrics: timeUnixNano: "1661128093795620000" isMonotonic: true unit: '{operations}' - - description: Percent of CPU used by the container. + - description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.' gauge: dataPoints: - asDouble: 0.0002888012543185477 diff --git a/receiver/dockerstatsreceiver/testdata/mock/two_containers/expected_metrics.yaml b/receiver/dockerstatsreceiver/testdata/mock/two_containers/expected_metrics.yaml index f846fd631aa2..0fa04d2e8438 100644 --- a/receiver/dockerstatsreceiver/testdata/mock/two_containers/expected_metrics.yaml +++ b/receiver/dockerstatsreceiver/testdata/mock/two_containers/expected_metrics.yaml @@ -195,7 +195,7 @@ resourceMetrics: timeUnixNano: "1661128790158163000" isMonotonic: true unit: '{operations}' - - description: Percent of CPU used by the container. + - description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.' gauge: dataPoints: - asDouble: 0 @@ -884,7 +884,7 @@ resourceMetrics: timeUnixNano: "1661128790158163000" isMonotonic: true unit: '{operations}' - - description: Percent of CPU used by the container. + - description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.' gauge: dataPoints: - asDouble: 0