Skip to content

Commit

Permalink
fix mountinfo path
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbeeSo committed Jan 19, 2024
1 parent 1f72b19 commit 55665f6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/metric/fuse_stat_collector.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package metric

import (
"crypto/sha256"
"fmt"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -663,13 +661,12 @@ func (p *usFsStatCollector) updateExclusiveMetrics(fsClientType, podUid string,

func (p *usFsStatCollector) updateSharedMetrics(fsClientType, subDir string, fsClientInfo *fuseInfo, ch chan<- prometheus.Metric) {

volSha := fmt.Sprintf("%x", sha256.Sum256([]byte(subDir)))
volPath := filepath.Join(fsClientPathPrefix, fsClientType, volSha)
volPath := filepath.Join(fsClientPathPrefix, fsClientType, subDir)
p.postVolMetrics(volPath, fsClientInfo, ch)
}

func (p *usFsStatCollector) postVolMetrics(volPath string, fsClientInfo *fuseInfo, ch chan<- prometheus.Metric) {
mountPointInfoArray, err := readFirstLines(volPath)
mountPointInfoArray, err := readFirstLines(filepath.Join(volPath, mountPointInfo))
if err != nil {
return
}
Expand Down

0 comments on commit 55665f6

Please sign in to comment.