diff --git a/cmd/collectors/restperf/restperf.go b/cmd/collectors/restperf/restperf.go index 99b280f45..8c0f00d32 100644 --- a/cmd/collectors/restperf/restperf.go +++ b/cmd/collectors/restperf/restperf.go @@ -687,11 +687,6 @@ func (r *RestPerf) PollData() (map[string]*matrix.Matrix, error) { startTime time.Time ) - mat := r.Matrix[r.Object] - if len(mat.GetInstances()) == 0 { - return nil, errs.New(errs.ErrNoInstance, "no "+r.Object+" instances fetched in PollInstance") - } - timestamp := r.Matrix[r.Object].GetMetric(timestampMetricName) if timestamp == nil { return nil, errs.New(errs.ErrConfig, "missing timestamp metric") @@ -703,7 +698,7 @@ func (r *RestPerf) PollData() (map[string]*matrix.Matrix, error) { dataQuery := path.Join(r.Prop.Query, "rows") var filter []string - // Sort filters so that the href is deterministic + // Sort metrics so that the href is deterministic metrics := slices.Sorted(maps.Keys(r.Prop.Metrics)) filter = append(filter, "counters.name="+strings.Join(metrics, "|")) @@ -870,10 +865,14 @@ func (r *RestPerf) pollData(startTime time.Time, perfRecords []rest.PerfRecord) instance = curMat.GetInstance(instanceKey) if instance == nil { - if !isWorkloadObject(r.Prop.Query) && !isWorkloadDetailObject(r.Prop.Query) { - r.Logger.Warn("Skip instanceKey, not found in cache", slog.String("instanceKey", instanceKey)) + if isWorkloadObject(r.Prop.Query) || isWorkloadDetailObject(r.Prop.Query) { + return true + } + instance, err = curMat.NewInstance(instanceKey) + if err != nil { + r.Logger.Error("add instance", slogx.Err(err), slog.String("instanceKey", instanceKey)) + return true } - return true } // check for partial aggregation @@ -1252,7 +1251,7 @@ func (r *RestPerf) pollData(startTime time.Time, perfRecords []rest.PerfRecord) } continue } - // If we reach here then one of the earlier clauses should have executed `continue` statement + // If we reach here, then one of the earlier clauses should have executed `continue` statement r.Logger.Error( "Unknown property", slog.String("key", key), diff --git a/conf/restperf/9.12.0/workload.yaml b/conf/restperf/9.12.0/workload.yaml index 9237b6554..823a7a57e 100644 --- a/conf/restperf/9.12.0/workload.yaml +++ b/conf/restperf/9.12.0/workload.yaml @@ -8,6 +8,7 @@ object: qos client_timeout: 1m30s schedule: + - instance: 10m - data: 3m counters: diff --git a/conf/restperf/9.12.0/workload_detail.yaml b/conf/restperf/9.12.0/workload_detail.yaml index 9e8deefa2..cb04097d0 100644 --- a/conf/restperf/9.12.0/workload_detail.yaml +++ b/conf/restperf/9.12.0/workload_detail.yaml @@ -9,6 +9,7 @@ object: qos_detail client_timeout: 1m30s schedule: + - instance: 10m - data: 3m counters: diff --git a/conf/restperf/9.12.0/workload_detail_volume.yaml b/conf/restperf/9.12.0/workload_detail_volume.yaml index 252188795..c85f24ff1 100644 --- a/conf/restperf/9.12.0/workload_detail_volume.yaml +++ b/conf/restperf/9.12.0/workload_detail_volume.yaml @@ -8,6 +8,7 @@ object: qos_detail client_timeout: 1m30s schedule: + - instance: 10m - data: 3m counters: diff --git a/conf/restperf/9.12.0/workload_volume.yaml b/conf/restperf/9.12.0/workload_volume.yaml index 3a7281dd4..3f9d4497d 100644 --- a/conf/restperf/9.12.0/workload_volume.yaml +++ b/conf/restperf/9.12.0/workload_volume.yaml @@ -10,6 +10,7 @@ object: qos client_timeout: 1m30s schedule: + - instance: 10m - data: 3m counters: diff --git a/conf/restperf/default.yaml b/conf/restperf/default.yaml index bde185711..d8ce8f530 100644 --- a/conf/restperf/default.yaml +++ b/conf/restperf/default.yaml @@ -4,7 +4,6 @@ collector: RestPerf # Order here matters! schedule: - counter: 24h - - instance: 10m - data: 1m objects: