Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 2 additions & 5 deletions plugins/input/systemv2/input_system_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"bytes"
"io"
"os"
"strconv"
"strings"

"github.com/alibaba/ilogtail/pkg/helper/containercenter"
Expand Down Expand Up @@ -163,10 +162,8 @@ func (r *InputSystem) CollectOpenFD(collector pipeline.Collector) {
logger.Warning(r.context.GetRuntimeContext(), "FILENR_PATTERN_ALARM", "want", 3, "got", len(parts))
return
}
allocated, _ := strconv.ParseFloat(string(parts[0]), 64)
maximum, _ := strconv.ParseFloat(string(parts[2]), 64)
r.addMetric(collector, "fd_allocated", &r.commonLabels, allocated)
r.addMetric(collector, "fd_max", &r.commonLabels, maximum)
r.addMetricStringVal(collector, "fd_allocated", &r.commonLabels, string(parts[0]))
r.addMetricStringVal(collector, "fd_max", &r.commonLabels, string(parts[2]))
}

// CollectDiskUsage use `/proc/1/mounts` to find the device rather than `proc/self/mounts`
Expand Down
4 changes: 4 additions & 0 deletions plugins/input/systemv2/input_system_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func (r *InputSystem) addMetric(collector pipeline.Collector, name string, label
collector.AddRawLog(helper.NewMetricLog(name, r.collectTime.UnixNano(), value, labels))
}

func (r *InputSystem) addMetricStringVal(collector pipeline.Collector, name string, labels *helper.MetricLabels, value string) {
collector.AddRawLog(helper.NewMetricLogStringVal(name, r.collectTime.UnixNano(), value, labels))
}

func (r *InputSystem) CollectCore(collector pipeline.Collector) {

// host info
Expand Down
Loading