Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .chloggen/add-vcenter-resource-pool-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Adds additional vCenter resource pool metrics and a memory_usage_type attribute for vcenter.resource_pool.memory.usage metric to use."

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [33607]

# (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: |
Added "vcenter.resource_pool.memory.swapped", "vcenter.resource_pool.memory.ballooned", and "vcenter.resource_pool.memory.granted"
metrics. Also added an additional attribute, "memory_usage_type" for "vcenter.resource_pool.memory.usage" metric, which is
currently under a feature gate.

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
9 changes: 9 additions & 0 deletions receiver/vcenterreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ The full list of settings exposed for this receiver are documented [here](./conf
Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) with further documentation in [documentation.md](./documentation.md)

### Feature gates

**ALPHA**: `receiver.vcenter.resourcePoolMemoryUsageAttribute`

The feature gate `receiver.vcenter.resourcePoolMemoryUsageAttribute` once enabled will enable the memory usage type attribute for
the `vcenter.resource_pool.memory.usage` metric.

This feature gate will eventually be enabled by default, and eventually the old implementation will be removed. It aims
to give users time to migrate to the new implementation. The target release for this featuregate to be enabled by default
is v0.106.0.
36 changes: 36 additions & 0 deletions receiver/vcenterreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ The usage of the memory by the resource pool.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| MiBy | Sum | Int | Cumulative | false |

#### Attributes

| Name | Description | Values |
| ---- | ----------- | ------ |
| type | The type of memory usage. | Str: ``guest``, ``host``, ``overhead`` |

### vcenter.vm.cpu.usage

The amount of CPU used by the VM.
Expand Down Expand Up @@ -526,6 +532,36 @@ As measured over the most recent 20s interval.
| direction | The direction of network throughput. | Str: ``transmitted``, ``received`` |
| object | The object on the virtual machine or host that is being reported on. | Any Str |

### vcenter.resource_pool.memory.ballooned

The amount of memory in a resource pool that is ballooned due to virtualization.

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

### vcenter.resource_pool.memory.granted

The amount of memory that is granted to VMs in the resource pool from shared and non-shared host memory.

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

#### Attributes

| Name | Description | Values |
| ---- | ----------- | ------ |
| type | The type of memory granted. | Str: ``private``, ``shared`` |

### vcenter.resource_pool.memory.swapped

The amount of memory that is granted to VMs in the resource pool from the host's swap space.

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

### vcenter.vm.cpu.readiness

Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU.
Expand Down
2 changes: 1 addition & 1 deletion receiver/vcenterreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
go.opentelemetry.io/collector/config/configtls v0.104.1-0.20240705135726-e014c1ed756c
go.opentelemetry.io/collector/confmap v0.104.1-0.20240705135726-e014c1ed756c
go.opentelemetry.io/collector/consumer v0.104.1-0.20240705135726-e014c1ed756c
go.opentelemetry.io/collector/featuregate v1.11.1-0.20240705135726-e014c1ed756c
go.opentelemetry.io/collector/filter v0.104.1-0.20240705135726-e014c1ed756c
go.opentelemetry.io/collector/pdata v1.11.1-0.20240705135726-e014c1ed756c
go.opentelemetry.io/collector/receiver v0.104.1-0.20240705135726-e014c1ed756c
Expand Down Expand Up @@ -88,7 +89,6 @@ require (
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/collector v0.104.1-0.20240705135726-e014c1ed756c // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.104.1-0.20240705135726-e014c1ed756c // indirect
go.opentelemetry.io/collector/featuregate v1.11.1-0.20240705135726-e014c1ed756c // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect
Expand Down
16 changes: 16 additions & 0 deletions receiver/vcenterreceiver/internal/metadata/custom.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package metadata // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver/internal/metadata"

import "go.opentelemetry.io/collector/pdata/pcommon"

func (mb *MetricsBuilder) RecordVcenterResourcePoolMemoryUsageDataPointWithoutTypeAttribute(ts pcommon.Timestamp, val int64) {
mb.metricVcenterResourcePoolMemoryUsage.recordDataPointWithoutType(ts, val)
}

func (m *metricVcenterResourcePoolMemoryUsage) recordDataPointWithoutType(ts pcommon.Timestamp, val int64) {
dp := m.data.Sum().DataPoints().AppendEmpty()
dp.SetTimestamp(ts)
dp.SetIntValue(val)
}
100 changes: 56 additions & 44 deletions receiver/vcenterreceiver/internal/metadata/generated_config.go

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

Loading