Skip to content

Commit bae7e6b

Browse files
authored
[receiver/vcenter] Updates vcenter.cluster.memory.effective metric (#32783)
**Description:** <Describe what has changed.> Currently the unit is incorrect for the reported metric value of `vcenter.cluster.memory.effective`. This updates the values to actually report in the unit of bytes (to match metadata). This also updates the metadata description to be a little more accurate **Link to tracking Issue:** <Issue number if applicable> #32782 **Testing:** <Describe what testing was performed and which tests were added.> Unit/integration tests updated and tested. Local environment tested. **Documentation:** <Describe the documentation added.> New documentation generated based on the metadata.
1 parent 36ffd33 commit bae7e6b

File tree

10 files changed

+41
-13
lines changed

10 files changed

+41
-13
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: vcenterreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Updates `vcenter.cluster.memory.effective` (primarily that the value was reporting MiB when it should have been bytes)"
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [32782]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

receiver/vcenterreceiver/documentation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ The number of hosts in the cluster.
4444
4545
### vcenter.cluster.memory.effective
4646
47-
The effective memory of the cluster. This value excludes memory from hosts in maintenance mode or are unresponsive.
47+
The effective available memory of the cluster.
48+
49+
This value excludes memory from hosts that are either in maintenance mode or are unresponsive. It also excludes memory used by the VMware Service Console.
4850
4951
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
5052
| ---- | ----------- | ---------- | ----------------------- | --------- |

receiver/vcenterreceiver/integration_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
//go:build integration
5-
64
package vcenterreceiver // import github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver
75

86
import (

receiver/vcenterreceiver/internal/metadata/generated_metrics.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/vcenterreceiver/internal/metadata/generated_metrics_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/vcenterreceiver/metadata.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,14 @@ metrics:
131131
attributes: []
132132
vcenter.cluster.memory.effective:
133133
enabled: true
134-
description: The effective memory of the cluster. This value excludes memory from hosts in maintenance mode or are unresponsive.
134+
description: The effective available memory of the cluster.
135135
unit: By
136136
sum:
137137
monotonic: false
138138
value_type: int
139139
aggregation_temporality: cumulative
140140
attributes: []
141+
extended_documentation: This value excludes memory from hosts that are either in maintenance mode or are unresponsive. It also excludes memory used by the VMware Service Console.
141142
vcenter.cluster.memory.used:
142143
enabled: true
143144
description: The memory that is currently used by the cluster.

receiver/vcenterreceiver/scraper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (v *vcenterMetricScraper) collectCluster(
151151
s := moCluster.Summary.GetComputeResourceSummary()
152152
v.mb.RecordVcenterClusterCPULimitDataPoint(now, int64(s.TotalCpu))
153153
v.mb.RecordVcenterClusterCPUEffectiveDataPoint(now, int64(s.EffectiveCpu))
154-
v.mb.RecordVcenterClusterMemoryEffectiveDataPoint(now, s.EffectiveMemory)
154+
v.mb.RecordVcenterClusterMemoryEffectiveDataPoint(now, s.EffectiveMemory<<20)
155155
v.mb.RecordVcenterClusterMemoryLimitDataPoint(now, s.TotalMemory)
156156
v.mb.RecordVcenterClusterHostCountDataPoint(now, int64(s.NumHosts-s.NumEffectiveHosts), false)
157157
v.mb.RecordVcenterClusterHostCountDataPoint(now, int64(s.NumEffectiveHosts), true)

receiver/vcenterreceiver/testdata/integration/expected.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,12 +726,12 @@ resourceMetrics:
726726
startTimeUnixNano: "1707407684042820000"
727727
timeUnixNano: "1707407733803628000"
728728
unit: "{hosts}"
729-
- description: The effective memory of the cluster. This value excludes memory from hosts in maintenance mode or are unresponsive.
729+
- description: The effective available memory of the cluster.
730730
name: vcenter.cluster.memory.effective
731731
sum:
732732
aggregationTemporality: 2
733733
dataPoints:
734-
- asInt: "12883292160"
734+
- asInt: "13500061378877440"
735735
startTimeUnixNano: "1707407684042820000"
736736
timeUnixNano: "1707407733803628000"
737737
unit: By

receiver/vcenterreceiver/testdata/metrics/expected-all-enabled.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ resourceMetrics:
4747
startTimeUnixNano: "1000000"
4848
timeUnixNano: "2000000"
4949
unit: '{hosts}'
50-
- description: The effective memory of the cluster. This value excludes memory from hosts in maintenance mode or are unresponsive.
50+
- description: The effective available memory of the cluster.
5151
name: vcenter.cluster.memory.effective
5252
sum:
5353
aggregationTemporality: 2
5454
dataPoints:
55-
- asInt: "2140347"
55+
- asInt: "2244316495872"
5656
startTimeUnixNano: "1000000"
5757
timeUnixNano: "2000000"
5858
unit: By

receiver/vcenterreceiver/testdata/metrics/expected.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ resourceMetrics:
4444
startTimeUnixNano: "1000000"
4545
timeUnixNano: "2000000"
4646
unit: '{hosts}'
47-
- description: The effective memory of the cluster. This value excludes memory from hosts in maintenance mode or are unresponsive.
47+
- description: The effective available memory of the cluster.
4848
name: vcenter.cluster.memory.effective
4949
sum:
5050
aggregationTemporality: 2
5151
dataPoints:
52-
- asInt: "2140347"
52+
- asInt: "2244316495872"
5353
startTimeUnixNano: "1000000"
5454
timeUnixNano: "2000000"
5555
unit: By

0 commit comments

Comments
 (0)