Skip to content

Commit

Permalink
[receiver/hostmetrics] remove direction attribute (#11820)
Browse files Browse the repository at this point in the history
* [receiver/hostmetrics/networkscraper] remove direction

The following change adds the direction to the metric name, removing the `direction` attribute.

Fixes #11817

* update changelog

* put direction change behind feature gate

* add comment
  • Loading branch information
codeboten authored Jun 30, 2022
1 parent 057d0b7 commit 10f4bd0
Show file tree
Hide file tree
Showing 7 changed files with 816 additions and 68 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
### 🚩 Deprecations 🚩

- `logzioexporter`: Announcing `custom_endpoint`, `drain_interval`, `queue_capacity`, `queue_max_length` configuration options will be deprecated in upcoming releases (#10821)
- `hostmetricsreceiver`: remove direction attribute. The feature gate: `receiver.hostmetricsreceiver.removeDirectionAttribute` can be set to apply the following (#11820)
- `system.network.dropped` will become:
- `system.network.dropped.receive`
- `system.network.dropped.transmit`
- `system.network.errors` will become:
- `system.network.errors.receive`
- `system.network.errors.transmit`
- `system.network.io` will become:
- `system.network.io.receive`
- `system.network.io.transmit`
- `system.network.packets` will become:
- `system.network.packets.receive`
- `system.network.packets.transmit`

### 🚀 New components 🚀

Expand Down
50 changes: 47 additions & 3 deletions receiver/hostmetricsreceiver/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Host Metrics Receiver

| Status | |
| ------------------------ |-------------------|
| ------------------------ | ----------------- |
| Stability | [beta] |
| Supported pipeline types | metrics |
| Distributions | [core], [contrib] |
Expand All @@ -27,14 +27,14 @@ hostmetrics:
The available scrapers are:

| Scraper | Supported OSs | Description |
|------------|------------------------------|--------------------------------------------------------|
| ---------- | ---------------------------- | ------------------------------------------------------ |
| cpu | All except Mac<sup>[1]</sup> | CPU utilization metrics |
| disk | All except Mac<sup>[1]</sup> | Disk I/O metrics |
| load | All | CPU load metrics |
| filesystem | All | File System utilization metrics |
| memory | All | Memory utilization metrics |
| network | All | Network interface I/O metrics & TCP connection metrics |
| paging | All | Paging/Swap space utilization and I/O metrics
| paging | All | Paging/Swap space utilization and I/O metrics |
| processes | Linux | Process count metrics |
| process | Linux & Windows | Per process CPU, Memory, and Disk I/O metrics |

Expand Down Expand Up @@ -130,6 +130,50 @@ service:
receivers: [hostmetrics, hostmetrics/disk]
```

### Feature gate configurations

- `receiver.hostmetricsreceiver.removeDirectionAttributeNetworkMetrics`
- Description
- Some network metrics reported by the hostmetricsreceiver are transitioning from being reported
with a direction attribute to being reported with the direction included in the metric name to adhere to the
OpenTelemetry specification. Please update any monitoring this might affect.
- Affected Metrics
- `system.network.dropped` will become:
- `system.network.dropped.receive`
- `system.network.dropped.transmit`
- `system.network.errors` will become:
- `system.network.errors.receive`
- `system.network.errors.transmit`
- `system.network.io` will become:
- `system.network.io.receive`
- `system.network.io.transmit`
- `system.network.packets` will become:
- `system.network.packets.receive`
- `system.network.packets.transmit`
- Stages and Timeline
- Alpha (current stage)
- In this stage the feature gate is disabled by default and must be enabled by the user. This allows users to preemptively opt in and start using the bug fix by enabling the feature gate.
- Collector version: v0.55.0
- Release Date: Early July 2022
- Beta
- In this stage the feature gate is enabled by default and can be disabled by the user.
- Collector version: v0.57.0
- Release Date: Early August 2022
- Generally Available
- In this stage the feature gate is permanently enabled and the feature gate is no longer available for anyone.
- Users could experience some friction in this stage, they may have to update monitoring for the affected metrics or be blocked from upgrading the collector to versions v0.59.0 and newer.
- Collector version: v0.59.0
- Release Date: Early September 2022
- Usage
- Feature gate identifiers prefixed with - will disable the gate and prefixing with + or with no prefix will enable the gate.
- Start the otelcol with the feature gate enabled:
- otelcol {other_arguments} --feature-gates=receiver.k8sclusterreceiver.reportCpuMetricsAsDouble
- Start the otelcol with the feature gate disabled:
- otelcol {other_arguments} --feature-gates=-receiver.k8sclusterreceiver.reportCpuMetricsAsDouble
- More information:
- https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/11815
- https://github.com/open-telemetry/opentelemetry-specification/pull/2617

[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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ These are the metrics available for this scraper.
| Name | Description | Unit | Type | Attributes |
| ---- | ----------- | ---- | ---- | ---------- |
| **system.network.connections** | The number of connections. | {connections} | Sum(Int) | <ul> <li>protocol</li> <li>state</li> </ul> |
| **system.network.dropped** | The number of packets dropped. | {packets} | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.errors** | The number of errors encountered. | {errors} | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.io** | The number of bytes transmitted and received. | By | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.packets** | The number of packets transferred. | {packets} | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.dropped** | The number of packets dropped. (Deprecated) | {packets} | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.dropped.receive** | The number of packets dropped on receive. | {packets} | Sum(Int) | <ul> <li>device</li> </ul> |
| **system.network.dropped.transmit** | The number of packets dropped on transmit. | {packets} | Sum(Int) | <ul> <li>device</li> </ul> |
| **system.network.errors** | The number of errors encountered. (Deprecated) | {errors} | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.errors.receive** | The number of errors encountered on receive. | {errors} | Sum(Int) | <ul> <li>device</li> </ul> |
| **system.network.errors.transmit** | The number of errors encountered on transmit. | {errors} | Sum(Int) | <ul> <li>device</li> </ul> |
| **system.network.io** | The number of bytes transmitted and received. (Deprecated) | By | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.io.receive** | The number of bytes received. | By | Sum(Int) | <ul> <li>device</li> </ul> |
| **system.network.io.transmit** | The number of bytes transmitted. | By | Sum(Int) | <ul> <li>device</li> </ul> |
| **system.network.packets** | The number of packets transferred. (Deprecated) | {packets} | Sum(Int) | <ul> <li>device</li> <li>direction</li> </ul> |
| **system.network.packets.receive** | The number of packets received. | {packets} | Sum(Int) | <ul> <li>device</li> </ul> |
| **system.network.packets.transmit** | The number of packets transmitted. | {packets} | Sum(Int) | <ul> <li>device</li> </ul> |

**Highlighted metrics** are emitted by default. Other metrics are optional and not emitted by default.
Any metric can be enabled or disabled with the following scraper configuration:
Expand Down
Loading

0 comments on commit 10f4bd0

Please sign in to comment.