Skip to content

Conversation

@Arunodoy18
Copy link

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: none is 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:

service:
  telemetry:
    metrics:
      level: none
      
Solution
This change adds a conditional check before registering process metrics. The registration is now skipped when the telemetry metrics level is set to LevelNone, preventing errors on unsupported platforms.

The fix follows the same pattern used in other parts of the codebase (e.g., [metrics.go](vscode-file://vscode-app/c:/Users/aruno/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html)) where metrics functionality is disabled when level is set to none.

Changes
Added import for otelconftelemetry package to access telemetry configuration
Added conditional check to skip [RegisterProcessMetrics](vscode-file://vscode-app/c:/Users/aruno/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) when [cfg.Telemetry.Metrics.Level == configtelemetry.LevelNone](vscode-file://vscode-app/c:/Users/aruno/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
Testing
This fix ensures that:

Collectors compiled for unsupported platforms (AIX, etc.) can start when metrics level is set to none
Process metrics are still registered on supported platforms when metrics level is not none
Related Issues
Fixes regression of #12098
Addresses the issue affecting all releases starting with v0.136.0

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.
@Arunodoy18 Arunodoy18 requested a review from a team as a code owner January 1, 2026 08:33
@Arunodoy18
Copy link
Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid unrelated changes

@dmitryax
Copy link
Member

dmitryax commented Jan 4, 2026

@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 gopsutil. We don't document that. Maybe we just better ignore those particular metrics on the unsupported OSes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants