Skip to content

Commit

Permalink
[receiver/vcenter] Fix incorrect KBy and MBy units (open-telemetry#14108
Browse files Browse the repository at this point in the history
)

The vcenter receiver indicates that it uses kilobytes (kBy), but instead the units are actually kibibytes (KiBy). The vSphere API docs claims they are in kilobytes, but documentation on the data counters units indicates that they use kilobytes to mean 1024 bytes, which in UCUM is actually kibibytes (KiBy).

Similar logic applies to the MBy units. VMware, in general, seems to prefer returning in power of 2 units instead of power of 10 units.
  • Loading branch information
BinaryFissionGames committed Sep 13, 2022
1 parent 26bab7e commit 8f0d825
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 56 deletions.
22 changes: 11 additions & 11 deletions receiver/vcenterreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ These are the metrics available for this scraper.
| **vcenter.host.disk.latency.avg.read** | The latency of reads to the host system's disk. This latency is the sum of the device and kernel read latencies. Requires Performance Counter level 2 for metric to populate. | ms | Gauge(Int) | <ul> </ul> |
| **vcenter.host.disk.latency.avg.write** | The latency of writes to the host system's disk. This latency is the sum of the device and kernel write latencies. Requires Performance Counter level 2 for metric to populate. | ms | Gauge(Int) | <ul> </ul> |
| **vcenter.host.disk.latency.max** | Highest latency value across all disks used by the host. As measured over the most recent 20s interval. Requires Performance Level 3. | ms | Gauge(Int) | <ul> </ul> |
| **vcenter.host.disk.throughput** | Average number of kilobytes read from or written to the disk each second. As measured over the most recent 20s interval. Aggregated disk I/O rate. Requires Performance Level 4. | {KBy/s} | Sum(Int) | <ul> <li>disk_direction</li> </ul> |
| **vcenter.host.disk.throughput.read** | Average number of kilobytes read from the disk each second. As measured over the most recent 20s interval. Aggregated disk read rate. Requires Performance Level 4. | {KBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.disk.throughput.write** | Average number of kilobytes written to the disk each second. As measured over the most recent 20s interval. Aggregated disk write rate. Requires Performance Level 4. | {KBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.memory.usage** | The amount of memory the host system is using. | MBy | Sum(Int) | <ul> </ul> |
| **vcenter.host.disk.throughput** | Average number of kilobytes read from or written to the disk each second. As measured over the most recent 20s interval. Aggregated disk I/O rate. Requires Performance Level 4. | {KiBy/s} | Sum(Int) | <ul> <li>disk_direction</li> </ul> |
| **vcenter.host.disk.throughput.read** | Average number of kilobytes read from the disk each second. As measured over the most recent 20s interval. Aggregated disk read rate. Requires Performance Level 4. | {KiBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.disk.throughput.write** | Average number of kilobytes written to the disk each second. As measured over the most recent 20s interval. Aggregated disk write rate. Requires Performance Level 4. | {KiBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.memory.usage** | The amount of memory the host system is using. | MiBy | Sum(Int) | <ul> </ul> |
| **vcenter.host.memory.utilization** | The percentage of the host system's memory capacity that is being utilized. | % | Gauge(Double) | <ul> </ul> |
| **vcenter.host.network.packet.count** | The number of packets transmitted and received, as measured over the most recent 20s interval. | {packets/sec} | Sum(Int) | <ul> <li>throughput_direction</li> </ul> |
| **vcenter.host.network.packet.count.receive** | The number of packets received, as measured over the most recent 20s interval. | {packets/sec} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.packet.count.transmit** | The number of packets transmitted, as measured over the most recent 20s interval. | {packets/sec} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.packet.errors** | The summation of packet errors on the host network. As measured over the most recent 20s interval. | {errors} | Sum(Int) | <ul> <li>throughput_direction</li> </ul> |
| **vcenter.host.network.packet.errors.receive** | The summation of receive packet errors on the host network. As measured over the most recent 20s interval. | {errors} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.packet.errors.transmit** | The summation of transmit packet errors on the host network. As measured over the most recent 20s interval. | {errors} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.throughput** | The amount of data that was transmitted or received over the network by the host. As measured over the most recent 20s interval. | {KBy/s} | Sum(Int) | <ul> <li>throughput_direction</li> </ul> |
| **vcenter.host.network.throughput.receive** | The amount of data that was received over the network by the host. As measured over the most recent 20s interval. | {KBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.throughput.transmit** | The amount of data that was transmitted over the network by the host. As measured over the most recent 20s interval. | {KBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.usage** | The sum of the data transmitted and received for all the NIC instances of the host. | {KBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.throughput** | The amount of data that was transmitted or received over the network by the host. As measured over the most recent 20s interval. | {KiBy/s} | Sum(Int) | <ul> <li>throughput_direction</li> </ul> |
| **vcenter.host.network.throughput.receive** | The amount of data that was received over the network by the host. As measured over the most recent 20s interval. | {KiBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.throughput.transmit** | The amount of data that was transmitted over the network by the host. As measured over the most recent 20s interval. | {KiBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.host.network.usage** | The sum of the data transmitted and received for all the NIC instances of the host. | {KiBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.resource_pool.cpu.shares** | The amount of shares of CPU in the resource pool. | {shares} | Sum(Int) | <ul> </ul> |
| **vcenter.resource_pool.cpu.usage** | The usage of the CPU used by the resource pool. | {MHz} | Sum(Int) | <ul> </ul> |
| **vcenter.resource_pool.memory.shares** | The amount of shares of memory in the resource pool. | {shares} | Sum(Int) | <ul> </ul> |
| **vcenter.resource_pool.memory.usage** | The usage of the memory by the resource pool. | MBy | Sum(Int) | <ul> </ul> |
| **vcenter.resource_pool.memory.usage** | The usage of the memory by the resource pool. | MiBy | Sum(Int) | <ul> </ul> |
| **vcenter.vm.disk.latency.avg** | The latency of operations to the virtual machine's disk. Requires Performance Counter level 2 for metric to populate. As measured over the most recent 20s interval. | ms | Gauge(Int) | <ul> <li>disk_direction</li> <li>disk_type</li> </ul> |
| **vcenter.vm.disk.latency.avg.read** | The latency of reads to the virtual machine's disk. Requires Performance Counter level 2 for metric to populate. As measured over the most recent 20s interval. | ms | Gauge(Int) | <ul> <li>disk_type</li> </ul> |
| **vcenter.vm.disk.latency.avg.write** | The latency of writes to the virtual machine's disk. Requires Performance Counter level 2 for metric to populate. As measured over the most recent 20s interval. | ms | Gauge(Int) | <ul> <li>disk_type</li> </ul> |
Expand All @@ -50,14 +50,14 @@ These are the metrics available for this scraper.
| **vcenter.vm.disk.usage** | The amount of storage space used by the virtual machine. | By | Sum(Int) | <ul> <li>disk_state</li> </ul> |
| **vcenter.vm.disk.utilization** | The utilization of storage on the virtual machine. | % | Gauge(Double) | <ul> </ul> |
| **vcenter.vm.memory.ballooned** | The amount of memory that is ballooned due to virtualization. | By | Sum(Int) | <ul> </ul> |
| **vcenter.vm.memory.usage** | The amount of memory that is used by the virtual machine. | MBy | Sum(Int) | <ul> </ul> |
| **vcenter.vm.memory.usage** | The amount of memory that is used by the virtual machine. | MiBy | Sum(Int) | <ul> </ul> |
| **vcenter.vm.network.packet.count** | The amount of packets that was received or transmitted over the instance's network. | {packets/sec} | Sum(Int) | <ul> <li>throughput_direction</li> </ul> |
| **vcenter.vm.network.packet.count.receive** | The amount of packets that was received over the instance's network. | {packets/sec} | Sum(Int) | <ul> </ul> |
| **vcenter.vm.network.packet.count.transmit** | The amount of packets that was transmitted over the instance's network. | {packets/sec} | Sum(Int) | <ul> </ul> |
| **vcenter.vm.network.throughput** | The amount of data that was transmitted or received over the network of the virtual machine. As measured over the most recent 20s interval. | By/sec | Sum(Int) | <ul> <li>throughput_direction</li> </ul> |
| **vcenter.vm.network.throughput.receive** | The amount of data that was received over the network of the virtual machine. As measured over the most recent 20s interval. | By/sec | Sum(Int) | <ul> </ul> |
| **vcenter.vm.network.throughput.transmit** | The amount of data that was transmitted over the network of the virtual machine. As measured over the most recent 20s interval. | By/sec | Sum(Int) | <ul> </ul> |
| **vcenter.vm.network.usage** | The network utilization combined transmit and receive rates during an interval. As measured over the most recent 20s interval. | {KBy/s} | Sum(Int) | <ul> </ul> |
| **vcenter.vm.network.usage** | The network utilization combined transmit and receive rates during an interval. As measured over the most recent 20s interval. | {KiBy/s} | Sum(Int) | <ul> </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
22 changes: 11 additions & 11 deletions receiver/vcenterreceiver/internal/metadata/generated_metrics.go

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

22 changes: 11 additions & 11 deletions receiver/vcenterreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ metrics:
vcenter.host.disk.throughput:
enabled: true
description: Average number of kilobytes read from or written to the disk each second.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand All @@ -175,7 +175,7 @@ metrics:
vcenter.host.disk.throughput.read:
enabled: true
description: Average number of kilobytes read from the disk each second.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand All @@ -185,7 +185,7 @@ metrics:
vcenter.host.disk.throughput.write:
enabled: true
description: Average number of kilobytes written to the disk each second.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand Down Expand Up @@ -234,7 +234,7 @@ metrics:
vcenter.host.memory.usage:
enabled: true
description: The amount of memory the host system is using.
unit: MBy
unit: MiBy
sum:
monotonic: false
value_type: int
Expand All @@ -244,7 +244,7 @@ metrics:
vcenter.host.network.throughput:
enabled: true
description: The amount of data that was transmitted or received over the network by the host.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand All @@ -255,7 +255,7 @@ metrics:
vcenter.host.network.throughput.receive:
enabled: true
description: The amount of data that was received over the network by the host.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand All @@ -265,7 +265,7 @@ metrics:
vcenter.host.network.throughput.transmit:
enabled: true
description: The amount of data that was transmitted over the network by the host.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand All @@ -274,7 +274,7 @@ metrics:
vcenter.host.network.usage:
enabled: true
description: The sum of the data transmitted and received for all the NIC instances of the host.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand Down Expand Up @@ -342,7 +342,7 @@ metrics:
vcenter.resource_pool.memory.usage:
enabled: true
description: The usage of the memory by the resource pool.
unit: MBy
unit: MiBy
sum:
monotonic: false
value_type: int
Expand Down Expand Up @@ -387,7 +387,7 @@ metrics:
vcenter.vm.memory.usage:
enabled: true
description: The amount of memory that is used by the virtual machine.
unit: MBy
unit: MiBy
sum:
monotonic: false
value_type: int
Expand Down Expand Up @@ -514,7 +514,7 @@ metrics:
vcenter.vm.network.usage:
enabled: true
description: The network utilization combined transmit and receive rates during an interval.
unit: "{KBy/s}"
unit: "{KiBy/s}"
sum:
monotonic: false
value_type: int
Expand Down
Loading

0 comments on commit 8f0d825

Please sign in to comment.