diff --git a/cmd/collectors/restperf/restperf.go b/cmd/collectors/restperf/restperf.go index 09cdba4b0..f986099be 100644 --- a/cmd/collectors/restperf/restperf.go +++ b/cmd/collectors/restperf/restperf.go @@ -640,6 +640,7 @@ func (r *RestPerf) PollData() (map[string]*matrix.Matrix, error) { for name, metric := range r.Prop.Metrics { f := parseMetricResponse(instanceData, name) if f.value != "" { + description := strings.ToLower(r.perfProp.counterInfo[name].description) // special case for workload_detail if isWorkloadDetailObject(r.Prop.Query) { if name == "wait_time" || name == "service_time" { @@ -680,7 +681,7 @@ func (r *RestPerf) PollData() (map[string]*matrix.Matrix, error) { // ONTAP does not have a `type` for histogram. Harvest tests the `desc` field to determine // if a counter is a histogram isHistogram = false - if len(labels) > 0 && strings.Contains(r.perfProp.counterInfo[name].description, "histogram") { + if len(labels) > 0 && strings.Contains(description, "histogram") { key := name + ".bucket" histogramMetric = curMat.GetMetric(key) if histogramMetric != nil { @@ -828,7 +829,7 @@ func (r *RestPerf) PollData() (map[string]*matrix.Matrix, error) { orderedDenominatorKeys := make([]string, 0, len(orderedDenominatorMetrics)) for key, metric := range curMat.GetMetrics() { - if metric.GetName() != "timestamp" { + if metric.GetName() != "timestamp" && metric.Buckets() == nil { counter := r.counterLookup(metric, key) if counter != nil { if counter.denominator == "" { diff --git a/cmd/collectors/zapiperf/zapiperf.go b/cmd/collectors/zapiperf/zapiperf.go index 0ce1621ad..6e33ea0e5 100644 --- a/cmd/collectors/zapiperf/zapiperf.go +++ b/cmd/collectors/zapiperf/zapiperf.go @@ -557,13 +557,13 @@ func (z *ZapiPerf) PollData() (map[string]*matrix.Matrix, error) { orderedKeys := make([]string, 0, len(orderedMetrics)) for key, metric := range curMat.GetMetrics() { - if metric.GetComment() == "" { // does not require base counter + if metric.GetComment() == "" && metric.Buckets() == nil { // does not require base counter orderedMetrics = append(orderedMetrics, metric) orderedKeys = append(orderedKeys, key) } } for key, metric := range curMat.GetMetrics() { - if metric.GetComment() != "" { // requires base counter + if metric.GetComment() != "" && metric.Buckets() == nil { // requires base counter orderedMetrics = append(orderedMetrics, metric) orderedKeys = append(orderedKeys, key) } diff --git a/pkg/matrix/matrix.go b/pkg/matrix/matrix.go index eadf56fa7..de84e35e7 100644 --- a/pkg/matrix/matrix.go +++ b/pkg/matrix/matrix.go @@ -153,7 +153,7 @@ func (m *Matrix) NewMetricType(key string, dataType string, display ...string) ( func newAbstract(key string, dataType string, display ...string) *Metric { name := key - if len(display) > 0 { + if len(display) > 0 && display[0] != "" { name = display[0] } return &Metric{name: name, dataType: dataType, exportable: true} @@ -330,6 +330,7 @@ func (m *Matrix) Delta(metricKey string, prevMat *Matrix, logger *logging.Logger skips++ logger.Trace(). Str("metric", curMetric.GetName()). + Str("key", key). Float64("currentRaw", curRaw). Float64("previousRaw", prevRaw[prevIndex]). Str("instKey", key). @@ -340,6 +341,7 @@ func (m *Matrix) Delta(metricKey string, prevMat *Matrix, logger *logging.Logger skips++ logger.Trace(). Str("metric", curMetric.GetName()). + Str("key", key). Float64("currentRaw", curRaw). Float64("previousRaw", prevRaw[prevIndex]). Str("instKey", key). @@ -350,6 +352,7 @@ func (m *Matrix) Delta(metricKey string, prevMat *Matrix, logger *logging.Logger skips++ logger.Trace(). Str("metric", curMetric.GetName()). + Str("key", key). Float64("currentRaw", curRaw). Str("instKey", key). Msg("New instance added") @@ -377,6 +380,7 @@ func (m *Matrix) Divide(metricKey string, baseKey string, logger *logging.Logger skips++ logger.Trace(). Str("metric", metric.GetName()). + Str("key", metricKey). Float64("numerator", metric.values[i]). Float64("denominator", sValues[i]). Msg("Divide calculation skipped") @@ -390,6 +394,7 @@ func (m *Matrix) Divide(metricKey string, baseKey string, logger *logging.Logger skips++ logger.Trace(). Str("metric", metric.GetName()). + Str("key", metricKey). Float64("numerator", metric.values[i]). Float64("denominator", sValues[i]). Msg("Divide calculation skipped") @@ -417,6 +422,7 @@ func (m *Matrix) DivideWithThreshold(metricKey string, baseKey string, threshold skips++ logger.Trace(). Str("metric", metric.GetName()). + Str("key", metricKey). Float64("numerator", v). Float64("denominator", sValues[i]). Msg("Negative values") @@ -433,6 +439,7 @@ func (m *Matrix) DivideWithThreshold(metricKey string, baseKey string, threshold skips++ logger.Trace(). Str("metric", metric.GetName()). + Str("key", metricKey). Float64("numerator", metric.values[i]). Float64("denominator", sValues[i]). Msg("Divide threshold calculation skipped") @@ -453,6 +460,7 @@ func (m *Matrix) MultiplyByScalar(metricKey string, s uint, logger *logging.Logg skips++ logger.Trace(). Str("metric", metric.GetName()). + Str("key", metricKey). Float64("currentRaw", metric.values[i]). Uint("scalar", s). Msg("Negative value") @@ -463,6 +471,7 @@ func (m *Matrix) MultiplyByScalar(metricKey string, s uint, logger *logging.Logg skips++ logger.Trace(). Str("metric", metric.GetName()). + Str("key", metricKey). Float64("currentRaw", metric.values[i]). Uint("scalar", s). Msg("Scalar multiplication skipped")