Fix process metrics registration when telemetry metrics level is none#14341
Fix process metrics registration when telemetry metrics level is none#14341Arunodoy18 wants to merge 3 commits intoopen-telemetry:mainfrom
Conversation
When service.telemetry.metrics.level is set to 'none', the collector should skip registering process metrics to avoid errors on platforms where gopsutil is not supported (such as AIX). This change conditionally registers process metrics only when the metrics level is not LevelNone, preventing the 'failed to register process metrics: not implemented yet' error on unsupported platforms. Fixes regression introduced in v0.136.0 where the check for metrics level was removed.
|
Thanks in advance for taking a look at this PR. I’ll actively follow up on feedback and make any required changes promptly—happy to adjust the approach or implementation as needed. |
Similar to the resolution for pcommon.Value in previous changes, this update ensures consistent documentation across all pdata types by clarifying that calling functions on zero-initialized instances is invalid usage. Changes: - Updated template files (one_of_field.go, one_of_message_value.go) to generate improved comment wording - Updated pcommon/value.go comments manually - Updated all generated pdata files to use consistent wording: 'is invalid and will cause a panic' instead of 'will cause a panic' This makes it clearer that using zero-initialized instances is not just dangerous but explicitly invalid usage, improving API documentation clarity.
| // SetBool replaces the bool value associated with this Value, | ||
| // it also changes the type to be ValueTypeBool. | ||
| // Calling this function on zero-initialized Value will cause a panic. | ||
| // Calling this function on zero-initialized Value is invalid and will cause a panic. |
|
@Arunodoy18 do you have the PR that broke it? Also, I'm not sure it's expected to require disabling the metrics on OSes unsupported by |
axw
left a comment
There was a problem hiding this comment.
Also, I'm not sure it's expected to require disabling the metrics on OSes unsupported by gopsutil. We don't document that.
Agreed. It's also not what other instrumentation (e.g. otelhttp, as installed by confighttp) does.
Maybe we just better ignore those particular metrics on the unsupported OSes?
+1 and that's what #14319 does.
I suggest we close this.
|
@Arunodoy18 Thank you for the PR! Based on the discussion here, and the reasoning given by @axw here #14319 (comment), I'm closing this PR in favor of #14319. I would encourage you to review that PR if you would like. Sorry if this isn't an ideal outcome, sometimes things come out during PR discussion and we have to shift direction. We hope you'll contribute in the future! |
Description
This PR fixes a regression introduced in v0.136.0 where custom compiled binaries for AIX (and other unsupported OSes) fail to start even when
service.telemetry.metrics.level: noneis configured.Problem
Starting from v0.136.0, the OpenTelemetry Collector fails to start on platforms where gopsutil is not supported (such as AIX) with the following error:
Error: failed to register process metrics: not implemented yet
This occurs even when the service configuration explicitly sets: