Skip to content

Commit 9188fa4

Browse files
authored
[receiver/vcenter] Adds additional resource pool metrics (open-telemetry#33741)
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> The following PR adds these [metrics](https://vdc-repo.vmware.com/vmwb-repository/dcr-public/d1902b0e-d479-46bf-8ac9-cee0e31e8ec0/07ce8dbd-db48-4261-9b8f-c6d3ad8ba472/vim.ResourcePool.Summary.QuickStats.html) ``` - vcenter.resource_pool.memory.swapped - vcenter.resource_pool.memory.ballooned - vcenter.resource_pool.memory.granted {memory_granted: shared / private} ``` It also adds the attribute `memory_usage_type` and splits up the `vcenter.resource_pool.memory.usage` metric into the following attributes: `host, guest, overhead` **Link to tracking Issue:** open-telemetry#33607 **Testing:** <Describe what testing was performed and which tests were added.> Golden files were generated to show the addition of the new metrics. **Documentation:** Documentation generated by `make generate`.
1 parent 3d05048 commit 9188fa4

File tree

15 files changed

+880
-245
lines changed

15 files changed

+880
-245
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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: enhancement
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: "Adds additional vCenter resource pool metrics and a memory_usage_type attribute for vcenter.resource_pool.memory.usage metric to use."
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: [33607]
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+
Added "vcenter.resource_pool.memory.swapped", "vcenter.resource_pool.memory.ballooned", and "vcenter.resource_pool.memory.granted"
20+
metrics. Also added an additional attribute, "memory_usage_type" for "vcenter.resource_pool.memory.usage" metric, which is
21+
currently under a feature gate.
22+
23+
# If your change doesn't affect end users or the exported elements of any package,
24+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
25+
# Optional: The change log or logs in which this entry should be included.
26+
# e.g. '[user]' or '[user, api]'
27+
# Include 'user' if the change is relevant to end users.
28+
# Include 'api' if there is a change to a library API.
29+
# Default: '[user]'
30+
change_logs: [user]

receiver/vcenterreceiver/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,12 @@ The full list of settings exposed for this receiver are documented [here](./conf
5555
Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) with further documentation in [documentation.md](./documentation.md)
5656
5757
### Feature gates
58+
59+
**ALPHA**: `receiver.vcenter.resourcePoolMemoryUsageAttribute`
60+
61+
The feature gate `receiver.vcenter.resourcePoolMemoryUsageAttribute` once enabled will enable the memory usage type attribute for
62+
the `vcenter.resource_pool.memory.usage` metric.
63+
64+
This feature gate will eventually be enabled by default, and eventually the old implementation will be removed. It aims
65+
to give users time to migrate to the new implementation. The target release for this featuregate to be enabled by default
66+
is v0.106.0.

receiver/vcenterreceiver/documentation.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ The usage of the memory by the resource pool.
283283
| ---- | ----------- | ---------- | ----------------------- | --------- |
284284
| MiBy | Sum | Int | Cumulative | false |
285285
286+
#### Attributes
287+
288+
| Name | Description | Values |
289+
| ---- | ----------- | ------ |
290+
| type | The type of memory usage. | Str: ``guest``, ``host``, ``overhead`` |
291+
286292
### vcenter.vm.cpu.usage
287293
288294
The amount of CPU used by the VM.
@@ -526,6 +532,36 @@ As measured over the most recent 20s interval.
526532
| direction | The direction of network throughput. | Str: ``transmitted``, ``received`` |
527533
| object | The object on the virtual machine or host that is being reported on. | Any Str |
528534
535+
### vcenter.resource_pool.memory.ballooned
536+
537+
The amount of memory in a resource pool that is ballooned due to virtualization.
538+
539+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
540+
| ---- | ----------- | ---------- | ----------------------- | --------- |
541+
| MiBy | Sum | Int | Cumulative | false |
542+
543+
### vcenter.resource_pool.memory.granted
544+
545+
The amount of memory that is granted to VMs in the resource pool from shared and non-shared host memory.
546+
547+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
548+
| ---- | ----------- | ---------- | ----------------------- | --------- |
549+
| MiBy | Sum | Int | Cumulative | false |
550+
551+
#### Attributes
552+
553+
| Name | Description | Values |
554+
| ---- | ----------- | ------ |
555+
| type | The type of memory granted. | Str: ``private``, ``shared`` |
556+
557+
### vcenter.resource_pool.memory.swapped
558+
559+
The amount of memory that is granted to VMs in the resource pool from the host's swap space.
560+
561+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
562+
| ---- | ----------- | ---------- | ----------------------- | --------- |
563+
| MiBy | Sum | Int | Cumulative | false |
564+
529565
### vcenter.vm.cpu.readiness
530566
531567
Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU.

receiver/vcenterreceiver/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
go.opentelemetry.io/collector/config/configtls v0.104.1-0.20240705135726-e014c1ed756c
1616
go.opentelemetry.io/collector/confmap v0.104.1-0.20240705135726-e014c1ed756c
1717
go.opentelemetry.io/collector/consumer v0.104.1-0.20240705135726-e014c1ed756c
18+
go.opentelemetry.io/collector/featuregate v1.11.1-0.20240705135726-e014c1ed756c
1819
go.opentelemetry.io/collector/filter v0.104.1-0.20240705135726-e014c1ed756c
1920
go.opentelemetry.io/collector/pdata v1.11.1-0.20240705135726-e014c1ed756c
2021
go.opentelemetry.io/collector/receiver v0.104.1-0.20240705135726-e014c1ed756c
@@ -88,7 +89,6 @@ require (
8889
github.com/yusufpapurcu/wmi v1.2.4 // indirect
8990
go.opentelemetry.io/collector v0.104.1-0.20240705135726-e014c1ed756c // indirect
9091
go.opentelemetry.io/collector/config/configtelemetry v0.104.1-0.20240705135726-e014c1ed756c // indirect
91-
go.opentelemetry.io/collector/featuregate v1.11.1-0.20240705135726-e014c1ed756c // indirect
9292
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
9393
go.opentelemetry.io/otel v1.28.0 // indirect
9494
go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package metadata // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver/internal/metadata"
5+
6+
import "go.opentelemetry.io/collector/pdata/pcommon"
7+
8+
func (mb *MetricsBuilder) RecordVcenterResourcePoolMemoryUsageDataPointWithoutTypeAttribute(ts pcommon.Timestamp, val int64) {
9+
mb.metricVcenterResourcePoolMemoryUsage.recordDataPointWithoutType(ts, val)
10+
}
11+
12+
func (m *metricVcenterResourcePoolMemoryUsage) recordDataPointWithoutType(ts pcommon.Timestamp, val int64) {
13+
dp := m.data.Sum().DataPoints().AppendEmpty()
14+
dp.SetTimestamp(ts)
15+
dp.SetIntValue(val)
16+
}

receiver/vcenterreceiver/internal/metadata/generated_config.go

Lines changed: 56 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)