Skip to content

Commit

Permalink
fix main process retrieve logic
Browse files Browse the repository at this point in the history
  • Loading branch information
shaowei su committed Oct 28, 2022
1 parent aee2109 commit afe9527
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/metricscollector/v1beta1/file-metricscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ func watchMetricsFile(mFile string, stopRules stopRulesFlag, filters []string, f
checkMetricFile(mFile)

// Get Main process.
_, mainProcPid, err := common.GetMainProcesses(mFile)
// Extract the metric file dir path based on the file name.
mDirPath, _ := filepath.Split(mFile)
_, mainProcPid, err := common.GetMainProcesses(mDirPath)
if err != nil {
klog.Fatalf("GetMainProcesses failed: %v", err)
}
Expand Down

0 comments on commit afe9527

Please sign in to comment.