Skip to content

Commit

Permalink
[receiver/hostmetrics] Remove deprecated process memory metrics (#18531)
Browse files Browse the repository at this point in the history
This is the last step of renaming the metrics process.memory.physical_usage and process.memory.virtual_usage to spec-compliant names process.memory.usage and process.memory.virtual. It should be released in v0.72.0.
  • Loading branch information
andrzej-stencel authored Feb 13, 2023
1 parent 57af8a9 commit e920e75
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 276 deletions.
19 changes: 19 additions & 0 deletions .chloggen/remove-deprecated-hostmetrics-receiver-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: hostmetricsreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated process memory metrics

# One or more tracking issues related to the change
issues: [14327]

# (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 metrics `process.memory.physical_usage` and `process.memory.virtual_usage` have been deprecated since v0.64.0.
They are now being removed. You should use the following metrics instead: `process.memory.usage`, `process.memory.virtual`.
For details, see the [docs](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.71.0/receiver/hostmetricsreceiver#transition-to-process-memory-metric-names-aligned-with-opentelemetry-specification).
47 changes: 0 additions & 47 deletions receiver/hostmetricsreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,53 +177,6 @@ Currently, the hostmetrics receiver does not set any Resource attributes on the
export OTEL_RESOURCE_ATTRIBUTES="service.name=<the name of your service>,service.namespace=<the namespace of your service>,service.instance.id=<uuid of the instance>"
```
## Deprecations
### Transition to process memory metric names aligned with OpenTelemetry specification
The Host Metrics receiver has been emitting the following process memory metrics:
- [process.memory.physical_usage] for the amount of physical memory used by the process,
- [process.memory.virtual_usage] for the amount of virtual memory used by the process.
This is in conflict with the OpenTelemetry specification,
which defines [process.memory.usage] and [process.memory.virtual] as the names for these metrics.
To align the emitted metric names with the OpenTelemetry specification,
the following process will be followed to phase out the old metrics:
- Until and including `v0.63.0`, only the old metrics `process.memory.physical_usage` and `process.memory.virtual_usage` are emitted.
You can use the [Metrics Transform processor][metricstransformprocessor_docs] to rename them.
- Between `v0.64.0` and `v0.68.0`, the new metrics are introduced as optional (disabled by default) and the old metrics are marked as deprecated.
Only the old metrics are emitted by default.
- Between `v0.69.0` and `v0.71.0`, the new metrics are enabled and the old metrics are disabled by default.
- In `v0.72.0` and up, the old metrics are 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:
hostmetrics:
scrapers:
process:
metrics:
process.memory.physical_usage:
enabled: false
process.memory.virtual_usage:
enabled: false
process.memory.usage:
enabled: true
process.memory.virtual:
enabled: true
```

[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol
[process.memory.physical_usage]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.63.0/receiver/hostmetricsreceiver/internal/scraper/processscraper/metadata.yaml#L61
[process.memory.virtual_usage]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.63.0/receiver/hostmetricsreceiver/internal/scraper/processscraper/metadata.yaml#L70
[process.memory.usage]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.14.0/specification/metrics/semantic_conventions/process-metrics.md?plain=1#L38
[process.memory.virtual]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.14.0/specification/metrics/semantic_conventions/process-metrics.md?plain=1#L39
[metricstransformprocessor_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.63.0/processor/metricstransformprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@ Number of disk operations performed by the process.
| ---- | ----------- | ------ |
| direction | Direction of flow of bytes (read or write). | Str: ``read``, ``write`` |
### process.memory.physical_usage
[DEPRECATED] Use `process.memory.usage` metric instead. The amount of physical memory in use.

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| By | Sum | Int | Cumulative | false |

### process.memory.utilization
Percentage of total physical memory that is used by the process.
Expand All @@ -124,14 +116,6 @@ Percentage of total physical memory that is used by the process.
| ---- | ----------- | ---------- |
| 1 | Gauge | Double |
### process.memory.virtual_usage

[DEPRECATED] Use `process.memory.virtual` metric instead. Virtual memory size.

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| By | Sum | Int | Cumulative | false |

### process.open_file_descriptors
Number of file descriptors in use by the process.
Expand Down

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

Loading

0 comments on commit e920e75

Please sign in to comment.