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/dockerstats] Disable deprecated cpu metric #24183

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3b60a3d
disable deprecated cpu metric
carlossscastro Jul 11, 2023
9235bcc
Merge branch 'main' into disable_deprecated_cpu_metric
carlossscastro Jul 25, 2023
f36fd00
Merge branch 'open-telemetry:main' into disable_deprecated_cpu_metric
carlossscastro Aug 8, 2023
cb5dbbc
update deprecation versions
carlossscastro Aug 8, 2023
73d0a44
Merge remote-tracking branch 'origin/disable_deprecated_cpu_metric' i…
carlossscastro Aug 8, 2023
2dd804a
Merge branch 'main' into disable_deprecated_cpu_metric
carlossscastro Aug 9, 2023
8577846
Merge branch 'main' into disable_deprecated_cpu_metric
carlossscastro Aug 9, 2023
4b60003
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Aug 11, 2023
7d9900f
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Aug 16, 2023
075ea68
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Aug 24, 2023
d0adf5f
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Aug 25, 2023
c913485
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Aug 28, 2023
d6e2cca
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Aug 29, 2023
e2e5a35
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Aug 31, 2023
241a0b2
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Sep 4, 2023
78f2812
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Sep 14, 2023
b323dbf
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Sep 29, 2023
2b55e14
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Oct 2, 2023
ee44402
chore: update deprecation notes
sigilioso Oct 2, 2023
1f4c199
chore: update deprecation notes in metadata.yaml
sigilioso Oct 2, 2023
4892c6a
Merge branch 'main' into disable_deprecated_cpu_metric
sigilioso Oct 5, 2023
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
23 changes: 23 additions & 0 deletions .chloggen/disable_deprecated_cpu_metric.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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: |
The metric `container.cpu.percentage` is now disabled by default and will be removed in v0.88.0.
As a replacement, the following metric is now enabled by default: `container.cpu.utilization`.
For details, see the [docs](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/dockerstatsreceiver#transition-to-cpu-utilization-metric-name-aligned-with-opentelemetry-specification).
6 changes: 3 additions & 3 deletions receiver/dockerstatsreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ 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.
- Between `v0.79.0` and `v0.86.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.
- In `v0.87.0`, the old metric is disabled and the new one enabled by default.
- In `v0.88.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.

Expand Down
32 changes: 16 additions & 16 deletions receiver/dockerstatsreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ More docs for [cgroups v1](https://www.kernel.org/doc/Documentation/cgroup-v1/bl
| device_minor | Device minor number for block IO operations. | Any Str |
| operation | Type of BlockIO operation. | Any Str |

### container.cpu.percent

Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.

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

### container.cpu.usage.kernelmode

Time spent by tasks of the cgroup in kernel mode (Linux). Time spent by all container processes in kernel mode (Windows).
Expand All @@ -62,6 +54,14 @@ Time spent by tasks of the cgroup in user mode (Linux). Time spent by all conta
| ---- | ----------- | ---------- | ----------------------- | --------- |
| 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.file

Amount of memory used to cache filesystem data, including tmpfs and shared memory (Only available with cgroups v2).
Expand Down Expand Up @@ -296,6 +296,14 @@ Number of sectors transferred to/from disk by the group and descendant groups (O
| device_minor | Device minor number for block IO operations. | Any Str |
| operation | Type of BlockIO operation. | Any Str |

### container.cpu.percent

[DEPRECATED] Use `container.cpu.utilization` metric instead. Percent of CPU used by the container.

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

### container.cpu.throttling_data.periods

Number of periods with throttling active.
Expand Down Expand Up @@ -344,14 +352,6 @@ 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.
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.

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

13 changes: 7 additions & 6 deletions receiver/dockerstatsreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,20 @@ metrics:
monotonic: true
aggregation_temporality: cumulative
container.cpu.utilization:
enabled: false
enabled: true
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: "Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container."
enabled: false
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.
if_configured: >-
The metric is deprecated and will be removed in v0.88.0. Please use `container.cpu.utilization` instead. See
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/dockerstatsreceiver#transition-to-cpu-utilization-metric-name-aligned-with-opentelemetry-specification
for more details.
gauge:
value_type: double

Expand Down
2 changes: 1 addition & 1 deletion receiver/dockerstatsreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var (
ContainerBlockioIoTimeRecursive: metricEnabled,
ContainerBlockioIoWaitTimeRecursive: metricEnabled,
ContainerBlockioSectorsRecursive: metricEnabled,
ContainerCPUPercent: metricEnabled,
ContainerCPUUtilization: metricEnabled,
ContainerCPUThrottlingDataPeriods: metricEnabled,
ContainerCPUThrottlingDataThrottledPeriods: metricEnabled,
ContainerCPUThrottlingDataThrottledTime: metricEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: By
- description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.041326615629205886
startTimeUnixNano: "1000000"
timeUnixNano: "2000000"
name: container.cpu.percent
unit: "1"
- description: Number of periods with throttling active.
name: container.cpu.throttling_data.periods
sum:
Expand Down Expand Up @@ -130,6 +122,14 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: ns
- description: 'Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.041326615629205886
startTimeUnixNano: "1687762436307743000"
timeUnixNano: "1687762436315926000"
name: container.cpu.utilization
unit: "1"
- description: The amount of anonymous memory that has been identified as active by the kernel.
name: container.memory.active_anon
sum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,6 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: '{operations}'
- description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.0002888012543185477
startTimeUnixNano: "1000000"
timeUnixNano: "2000000"
name: container.cpu.percent
unit: "1"
- description: Number of periods with throttling active.
name: container.cpu.throttling_data.periods
sum:
Expand Down Expand Up @@ -336,6 +328,14 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: ns
- description: 'Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.0002888012543185477
startTimeUnixNano: "1687762436220246000"
timeUnixNano: "1687762436230155000"
name: container.cpu.utilization
unit: "1"
- description: The amount of anonymous memory that has been identified as active by the kernel.
name: container.memory.active_anon
sum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: By
- description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0
startTimeUnixNano: "1000000"
timeUnixNano: "2000000"
name: container.cpu.percent
unit: "1"
- description: Number of periods with throttling active.
name: container.cpu.throttling_data.periods
sum:
Expand Down Expand Up @@ -182,6 +174,14 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: ns
- description: 'Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0
startTimeUnixNano: "1687762436274253000"
timeUnixNano: "1687762436282542000"
name: container.cpu.utilization
unit: "1"
- description: The amount of anonymous memory that has been identified as active by the kernel.
name: container.memory.active_anon
sum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: '{operations}'
- description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.0002888012543185477
startTimeUnixNano: "1000000"
timeUnixNano: "2000000"
name: container.cpu.percent
unit: "1"
- description: Number of periods with throttling active.
name: container.cpu.throttling_data.periods
sum:
Expand Down Expand Up @@ -342,6 +334,14 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: ns
- description: 'Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.0002888012543185477
startTimeUnixNano: "1687762436059456000"
timeUnixNano: "1687762436071484000"
name: container.cpu.utilization
unit: "1"
- description: The amount of anonymous memory that has been identified as active by the kernel.
name: container.memory.active_anon
sum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: '{operations}'
- description: 'Deprecated: use `container.cpu.utilization` metric instead. Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.0002888012543185477
startTimeUnixNano: "1000000"
timeUnixNano: "2000000"
name: container.cpu.percent
unit: "1"
- description: Number of periods with throttling active.
name: container.cpu.throttling_data.periods
sum:
Expand Down Expand Up @@ -342,6 +334,14 @@ resourceMetrics:
timeUnixNano: "2000000"
isMonotonic: true
unit: ns
- description: 'Percent of CPU used by the container.'
gauge:
dataPoints:
- asDouble: 0.0002888012543185477
startTimeUnixNano: "1687762436337809000"
timeUnixNano: "1687762436345613000"
name: container.cpu.utilization
unit: "1"
- description: The amount of anonymous memory that has been identified as active by the kernel.
name: container.memory.active_anon
sum:
Expand Down
Loading