Skip to content

Commit 876797c

Browse files
djaglowskiDougManton
authored andcommitted
[receiver/vcenter] Bump receiver.vcenter.emitPerfMetricsWithObjects gate to stable (open-telemetry#31215)
1 parent 4d2ddc8 commit 876797c

File tree

7 files changed

+42
-3617
lines changed

7 files changed

+42
-3617
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: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: receiver/vcenter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Bump receiver.vcenter.emitPerfMetricsWithObjects feature gate to stable
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: [31215]
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: []

receiver/vcenterreceiver/README.md

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,4 @@ Details about the metrics produced by this receiver can be found in [metadata.ya
5959
6060
### Feature gates
6161
62-
#### Performance metrics dimensions
63-
64-
These metrics were incorrectly dimensioned previously but the desired fix is a breaking change. To avoid breaking existing users, this feature gate is used to control whether the dimensions are fixed or not. This feature gate is planned to removed in two months.
65-
66-
- `vcenter.vm.network.throughput`
67-
- `vcenter.vm.network.usage`
68-
- `vcenter.vm.network.packet.count`
69-
- `vcenter.vm.disk.latency.avg`
70-
- `vcenter.vm.disk.latency.max`
71-
- `vcenter.host.network.usage`
72-
- `vcenter.host.network.throughput`
73-
- `vcenter.host.network.packet.count`
74-
- `vcenter.host.network.packet.errors`
75-
- `vcenter.host.disk.latency.avg`
76-
- `vcenter.host.disk.latency.max`
77-
- `vcenter.host.disk.throughput`
78-
79-
These metrics were improperly dimensioned and needed another metric attribute `object` in order to properly dimension the data.
80-
81-
#### v0.93.0, January 2024
82-
83-
- The receiver will emit the `object` metric attribute by default
84-
- `receiver.vcenter.emitPerfMetricsWithObjects` is *enabled* by default.
85-
86-
#### v0.95.0, February 2024
87-
88-
- The feature gates are removed.
89-
- Performance metrics will always include the `object` metric attribute.
62+
The `receiver.vcenter.emitPerfMetricsWithObjects` is now stable and will be removed in v0.97.0.

receiver/vcenterreceiver/metrics.go

Lines changed: 2 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,7 @@ func (v *vcenterMetricScraper) recordHostPerformanceMetrics(
152152
errs.AddPartial(1, err)
153153
return
154154
}
155-
if v.emitPerfWithObject {
156-
v.processHostPerformance(info.results)
157-
} else {
158-
v.processHostPerformanceWithoutObject(info.results)
159-
}
155+
v.processHostPerformance(info.results)
160156
}
161157

162158
// vmPerfMetricList may be customizable in the future but here is the full list of Virtual Machine Performance Counters
@@ -196,13 +192,7 @@ func (v *vcenterMetricScraper) recordVMPerformance(
196192
errs.AddPartial(1, err)
197193
return
198194
}
199-
200-
if v.emitPerfWithObject {
201-
v.processVMPerformanceMetrics(info)
202-
} else {
203-
v.processVMPerformanceMetricsWithoutObject(info)
204-
}
205-
195+
v.processVMPerformanceMetrics(info)
206196
}
207197

208198
func (v *vcenterMetricScraper) processVMPerformanceMetrics(info *perfSampleResult) {
@@ -240,41 +230,6 @@ func (v *vcenterMetricScraper) processVMPerformanceMetrics(info *perfSampleResul
240230
}
241231
}
242232

243-
func (v *vcenterMetricScraper) processVMPerformanceMetricsWithoutObject(info *perfSampleResult) {
244-
for _, m := range info.results {
245-
for _, val := range m.Value {
246-
for j, nestedValue := range val.Value {
247-
si := m.SampleInfo[j]
248-
switch val.Name {
249-
// Performance monitoring level 1 metrics
250-
case "net.bytesTx.average":
251-
v.mb.RecordVcenterVMNetworkThroughputDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionTransmitted)
252-
case "net.bytesRx.average":
253-
v.mb.RecordVcenterVMNetworkThroughputDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionReceived)
254-
case "net.usage.average":
255-
v.mb.RecordVcenterVMNetworkUsageDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue)
256-
case "net.packetsTx.summation":
257-
v.mb.RecordVcenterVMNetworkPacketCountDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionTransmitted)
258-
case "net.packetsRx.summation":
259-
v.mb.RecordVcenterVMNetworkPacketCountDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionReceived)
260-
261-
// Performance monitoring level 2 metrics required
262-
case "disk.totalReadLatency.average":
263-
v.mb.RecordVcenterVMDiskLatencyAvgDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionRead, metadata.AttributeDiskTypePhysical)
264-
case "virtualDisk.totalReadLatency.average":
265-
v.mb.RecordVcenterVMDiskLatencyAvgDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionRead, metadata.AttributeDiskTypeVirtual)
266-
case "disk.totalWriteLatency.average":
267-
v.mb.RecordVcenterVMDiskLatencyAvgDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionWrite, metadata.AttributeDiskTypePhysical)
268-
case "virtualDisk.totalWriteLatency.average":
269-
v.mb.RecordVcenterVMDiskLatencyAvgDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionWrite, metadata.AttributeDiskTypeVirtual)
270-
case "disk.maxTotalLatency.latest":
271-
v.mb.RecordVcenterVMDiskLatencyMaxDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue)
272-
}
273-
}
274-
}
275-
}
276-
}
277-
278233
func (v *vcenterMetricScraper) processHostPerformance(metrics []performance.EntityMetric) {
279234
for _, m := range metrics {
280235
for _, val := range m.Value {
@@ -315,44 +270,3 @@ func (v *vcenterMetricScraper) processHostPerformance(metrics []performance.Enti
315270
}
316271
}
317272
}
318-
319-
func (v *vcenterMetricScraper) processHostPerformanceWithoutObject(metrics []performance.EntityMetric) {
320-
for _, m := range metrics {
321-
for _, val := range m.Value {
322-
for j, nestedValue := range val.Value {
323-
si := m.SampleInfo[j]
324-
switch val.Name {
325-
// Performance monitoring level 1 metrics
326-
case "net.usage.average":
327-
v.mb.RecordVcenterHostNetworkUsageDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue)
328-
case "net.bytesTx.average":
329-
v.mb.RecordVcenterHostNetworkThroughputDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionTransmitted)
330-
case "net.bytesRx.average":
331-
v.mb.RecordVcenterHostNetworkThroughputDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionReceived)
332-
case "net.packetsTx.summation":
333-
v.mb.RecordVcenterHostNetworkPacketCountDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionTransmitted)
334-
case "net.packetsRx.summation":
335-
v.mb.RecordVcenterHostNetworkPacketCountDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionReceived)
336-
337-
// Following requires performance level 2
338-
case "net.errorsRx.summation":
339-
v.mb.RecordVcenterHostNetworkPacketErrorsDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionReceived)
340-
case "net.errorsTx.summation":
341-
v.mb.RecordVcenterHostNetworkPacketErrorsDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeThroughputDirectionTransmitted)
342-
case "disk.totalWriteLatency.average":
343-
v.mb.RecordVcenterHostDiskLatencyAvgDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionWrite)
344-
case "disk.totalReadLatency.average":
345-
v.mb.RecordVcenterHostDiskLatencyAvgDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionRead)
346-
case "disk.maxTotalLatency.latest":
347-
v.mb.RecordVcenterHostDiskLatencyMaxDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue)
348-
349-
// Following requires performance level 4
350-
case "disk.read.average":
351-
v.mb.RecordVcenterHostDiskThroughputDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionRead)
352-
case "disk.write.average":
353-
v.mb.RecordVcenterHostDiskThroughputDataPointWithoutObject(pcommon.NewTimestampFromTime(si.Timestamp), nestedValue, metadata.AttributeDiskDirectionWrite)
354-
}
355-
}
356-
}
357-
}
358-
}

receiver/vcenterreceiver/scraper.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ const (
2525
emitPerfMetricsWithObjectsFeatureGateID = "receiver.vcenter.emitPerfMetricsWithObjects"
2626
)
2727

28-
var emitPerfMetricsWithObjects = featuregate.GlobalRegistry().MustRegister(
28+
var _ = featuregate.GlobalRegistry().MustRegister(
2929
emitPerfMetricsWithObjectsFeatureGateID,
30-
featuregate.StageBeta,
31-
featuregate.WithRegisterDescription("When enabled, the receiver emits vCenter performance metrics with object metric label dimension."),
30+
featuregate.StageStable,
31+
featuregate.WithRegisterToVersion("v0.97.0"),
3232
)
3333

3434
var _ receiver.Metrics = (*vcenterMetricScraper)(nil)
@@ -38,10 +38,10 @@ type vcenterMetricScraper struct {
3838
config *Config
3939
mb *metadata.MetricsBuilder
4040
logger *zap.Logger
41+
4142
// map of vm name => compute name
42-
vmToComputeMap map[string]string
43-
vmToResourcePool map[string]*object.ResourcePool
44-
emitPerfWithObject bool
43+
vmToComputeMap map[string]string
44+
vmToResourcePool map[string]*object.ResourcePool
4545
}
4646

4747
func newVmwareVcenterScraper(
@@ -51,13 +51,12 @@ func newVmwareVcenterScraper(
5151
) *vcenterMetricScraper {
5252
client := newVcenterClient(config)
5353
return &vcenterMetricScraper{
54-
client: client,
55-
config: config,
56-
logger: logger,
57-
mb: metadata.NewMetricsBuilder(config.MetricsBuilderConfig, settings),
58-
vmToComputeMap: make(map[string]string),
59-
vmToResourcePool: make(map[string]*object.ResourcePool),
60-
emitPerfWithObject: emitPerfMetricsWithObjects.IsEnabled(),
54+
client: client,
55+
config: config,
56+
logger: logger,
57+
mb: metadata.NewMetricsBuilder(config.MetricsBuilderConfig, settings),
58+
vmToComputeMap: make(map[string]string),
59+
vmToResourcePool: make(map[string]*object.ResourcePool),
6160
}
6261
}
6362

receiver/vcenterreceiver/scraper_test.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,38 +33,6 @@ func TestScrape(t *testing.T) {
3333
testScrape(ctx, t, cfg)
3434
}
3535

36-
func TestScrapeWithoutPerfObjects(t *testing.T) {
37-
ctx := context.Background()
38-
mockServer := mock.MockServer(t, false)
39-
defer mockServer.Close()
40-
41-
cfg := &Config{
42-
MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(),
43-
Endpoint: mockServer.URL,
44-
Username: mock.MockUsername,
45-
Password: mock.MockPassword,
46-
}
47-
48-
scraper := newVmwareVcenterScraper(zap.NewNop(), cfg, receivertest.NewNopCreateSettings())
49-
scraper.emitPerfWithObject = false
50-
51-
metrics, err := scraper.scrape(ctx)
52-
require.NoError(t, err)
53-
require.NotEqual(t, metrics.MetricCount(), 0)
54-
55-
goldenPath := filepath.Join("testdata", "metrics", "expected_without_objects.yaml")
56-
expectedMetrics, err := golden.ReadMetrics(goldenPath)
57-
require.NoError(t, err)
58-
59-
err = pmetrictest.CompareMetrics(expectedMetrics, metrics,
60-
pmetrictest.IgnoreStartTimestamp(), pmetrictest.IgnoreTimestamp(),
61-
pmetrictest.IgnoreResourceMetricsOrder(),
62-
pmetrictest.IgnoreMetricDataPointsOrder(),
63-
)
64-
require.NoError(t, err)
65-
require.NoError(t, scraper.Shutdown(ctx))
66-
}
67-
6836
func TestScrape_TLS(t *testing.T) {
6937
ctx := context.Background()
7038
mockServer := mock.MockServer(t, true)

0 commit comments

Comments
 (0)