diff --git a/.gitignore b/.gitignore index d0a8940254..872cd3bc97 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,6 @@ internal/plugins/externals/ebpf/demo/ internal/plugins/externals/ebpf/internal/testuitls/mysqlins/mysqlins internal/export/doc/zh/inputs/imgs/tracing.png /git + +# web cache +node_modules \ No newline at end of file diff --git a/internal/plugins/inputs/sqlserver/input.go b/internal/plugins/inputs/sqlserver/input.go index c21ed74e71..8191f20c7b 100644 --- a/internal/plugins/inputs/sqlserver/input.go +++ b/internal/plugins/inputs/sqlserver/input.go @@ -212,20 +212,22 @@ func (ipt *Input) getPerformanceCounters() { if key == "cntr_value" { // the raw value is a number and the key is cntr_value, store in fields - if v, err := strconv.ParseUint(raw, 10, 64); err == nil { - if v > uint64(math.MaxInt64) { - l.Warnf("%s exceed maxint64: %d > %d, ignored", key, v, int64(math.MaxInt64)) + if v, err := strconv.ParseFloat(raw, 64); err == nil { + if v > math.MaxInt64 { + l.Warnf("%s exceed maxint64: %d > %d, ignored", key, v, math.MaxInt64) continue } // store the counter_name and cntr_value as fields if counterName == "buffer_cache_hit_ratio" { - fields[counterName] = float64(v) + fields[counterName] = v } else { fields[counterName] = int64(v) } // remain the original format for "cntr_value": cntr_value fields[key] = int64(v) + } else { + l.Warnf("parse %s failed: %s", key, raw) } } else { str := strings.TrimSuffix(raw, "\\")