Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions .chloggen/fix-aix-crash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change_logs:
- change_type: bug_fix
component: opentelemetry-collector
note: "Fix panic in process metrics on unsupported OSes (e.g. AIX)"
issues: [14307]
11 changes: 8 additions & 3 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,14 @@
return nil, err
}

if err := proctelemetry.RegisterProcessMetrics(srv.telemetrySettings); err != nil {
return nil, fmt.Errorf("failed to register process metrics: %w", err)
}
// Only register process metrics on supported OSes.
// AIX is currently unsupported for process metrics, so we skip it to avoid crashing.

Check failure on line 238 in service/service.go

View workflow job for this annotation

GitHub Actions / CodeQL-Build

File is not properly formatted (gofumpt)

Check failure on line 238 in service/service.go

View workflow job for this annotation

GitHub Actions / lint

File is not properly formatted (gofumpt)
// For other OSes, we want to fail fast if registration fails.
if runtime.GOOS != "aix" {
if err := proctelemetry.RegisterProcessMetrics(srv.telemetrySettings); err != nil {
return nil, err
}
}
return srv, nil
}

Expand Down
Loading