Skip to content

Commit

Permalink
Fix process username failed to obtain of the container process
Browse files Browse the repository at this point in the history
  • Loading branch information
Cairry committed Sep 4, 2024
1 parent 5581120 commit 12cd678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion process.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (pgc ProcessGaugeCollect) Collect(metric chan<- prometheus.Metric) {
func registerMetric(proc *process.Process, pid int32, metric chan<- prometheus.Metric, pgc ProcessGaugeCollect) {
user, err := proc.Username()
if err != nil {
return
user = "unknown"
}

name, err := proc.Name()
Expand Down

0 comments on commit 12cd678

Please sign in to comment.