diff --git a/cmd/cc-backend/main.go b/cmd/cc-backend/main.go index 81d397d2..5b51b963 100644 --- a/cmd/cc-backend/main.go +++ b/cmd/cc-backend/main.go @@ -339,7 +339,7 @@ func runServer(ctx context.Context) error { err := metricdispatch.Init(mscfg) if err != nil { - cclog.Debugf("initializing metricdispatch: %v", err) + cclog.Debugf("error while initializing external metricdispatch: %v", err) } else { haveMetricstore = true } diff --git a/internal/metricdispatch/metricdata.go b/internal/metricdispatch/metricdata.go index 36a10004..3f03234e 100755 --- a/internal/metricdispatch/metricdata.go +++ b/internal/metricdispatch/metricdata.go @@ -74,11 +74,11 @@ func Init(rawConfig json.RawMessage) error { dec := json.NewDecoder(bytes.NewReader(rawConfig)) dec.DisallowUnknownFields() if err := dec.Decode(&configs); err != nil { - return fmt.Errorf("[METRICDISPATCH]> Metric Store Config Init: Could not decode config file '%s' Error: %s", rawConfig, err.Error()) + return fmt.Errorf("[METRICDISPATCH]> External Metric Store Config Init: Could not decode config file '%s' Error: %s", rawConfig, err.Error()) } if len(configs) == 0 { - return fmt.Errorf("[METRICDISPATCH]> No metric store configurations found in config file") + return fmt.Errorf("[METRICDISPATCH]> No external metric store configurations found in config file") } for _, config := range configs { diff --git a/internal/metricstoreclient/cc-metric-store-queries.go b/internal/metricstoreclient/cc-metric-store-queries.go index d42c9355..949efa10 100644 --- a/internal/metricstoreclient/cc-metric-store-queries.go +++ b/internal/metricstoreclient/cc-metric-store-queries.go @@ -134,7 +134,7 @@ func (ccms *CCMetricStore) buildQueries( ) if len(hostQueries) == 0 && len(hostScopes) == 0 { - return nil, nil, fmt.Errorf("METRICDATA/CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) + return nil, nil, fmt.Errorf("METRICDATA/INTERNAL-CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) } queries = append(queries, hostQueries...) @@ -237,7 +237,7 @@ func (ccms *CCMetricStore) buildNodeQueries( ) if len(nodeQueries) == 0 && len(nodeScopes) == 0 { - return nil, nil, fmt.Errorf("METRICDATA/CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) + return nil, nil, fmt.Errorf("METRICDATA/EXTERNAL-CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) } queries = append(queries, nodeQueries...) diff --git a/internal/metricstoreclient/cc-metric-store.go b/internal/metricstoreclient/cc-metric-store.go index 7bf7d146..39c028d5 100644 --- a/internal/metricstoreclient/cc-metric-store.go +++ b/internal/metricstoreclient/cc-metric-store.go @@ -123,7 +123,7 @@ type APIMetricData struct { Max schema.Float `json:"max"` // Maximum value in time range } -// NewCCMetricStore creates and initializes a new CCMetricStore client. +// NewCCMetricStore creates and initializes a new (external) CCMetricStore client. // The url parameter should include the protocol and port (e.g., "http://localhost:8080"). // The token parameter is a JWT used for Bearer authentication; pass empty string if auth is disabled. func NewCCMetricStore(url string, token string) *CCMetricStore { @@ -356,7 +356,7 @@ func (ccms *CCMetricStore) LoadData( if len(errors) != 0 { /* Returns list for "partial errors" */ - return jobData, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return jobData, fmt.Errorf("METRICDATA/EXTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return jobData, nil } @@ -514,7 +514,7 @@ func (ccms *CCMetricStore) LoadScopedStats( if len(errors) != 0 { /* Returns list for "partial errors" */ - return scopedJobStats, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return scopedJobStats, fmt.Errorf("METRICDATA/EXTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return scopedJobStats, nil } @@ -604,7 +604,7 @@ func (ccms *CCMetricStore) LoadNodeData( if len(errors) != 0 { /* Returns list of "partial errors" */ - return data, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return data, fmt.Errorf("METRICDATA/EXTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return data, nil @@ -765,7 +765,7 @@ func (ccms *CCMetricStore) LoadNodeListData( if len(errors) != 0 { /* Returns list of "partial errors" */ - return data, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return data, fmt.Errorf("METRICDATA/EXTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return data, nil diff --git a/pkg/metricstore/query.go b/pkg/metricstore/query.go index 0a61efaa..735c45d6 100644 --- a/pkg/metricstore/query.go +++ b/pkg/metricstore/query.go @@ -211,7 +211,7 @@ func (ccms *InternalMetricStore) LoadData( if len(errors) != 0 { /* Returns list for "partial errors" */ - return jobData, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return jobData, fmt.Errorf("METRICDATA/INTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return jobData, nil } @@ -260,7 +260,7 @@ func buildQueries( resolution int64, ) ([]APIQuery, []schema.MetricScope, error) { if len(job.Resources) == 0 { - return nil, nil, fmt.Errorf("METRICDATA/CCMS > no resources allocated for job %d", job.JobID) + return nil, nil, fmt.Errorf("METRICDATA/INTERNAL-CCMS > no resources allocated for job %d", job.JobID) } queries := make([]APIQuery, 0, len(metrics)*len(scopes)*len(job.Resources)) @@ -531,7 +531,7 @@ func buildQueries( continue } - return nil, nil, fmt.Errorf("METRICDATA/CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) + return nil, nil, fmt.Errorf("METRICDATA/INTERNAL-CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) } } } @@ -719,7 +719,7 @@ func (ccms *InternalMetricStore) LoadScopedStats( if len(errors) != 0 { /* Returns list for "partial errors" */ - return scopedJobStats, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return scopedJobStats, fmt.Errorf("METRICDATA/INTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return scopedJobStats, nil } @@ -824,7 +824,7 @@ func (ccms *InternalMetricStore) LoadNodeData( if len(errors) != 0 { /* Returns list of "partial errors" */ - return data, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return data, fmt.Errorf("METRICDATA/INTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return data, nil @@ -994,7 +994,7 @@ func (ccms *InternalMetricStore) LoadNodeListData( if len(errors) != 0 { /* Returns list of "partial errors" */ - return data, fmt.Errorf("METRICDATA/CCMS > Errors: %s", strings.Join(errors, ", ")) + return data, fmt.Errorf("METRICDATA/INTERNAL-CCMS > Errors: %s", strings.Join(errors, ", ")) } return data, nil @@ -1313,7 +1313,7 @@ func buildNodeQueries( continue } - return nil, nil, fmt.Errorf("METRICDATA/CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) + return nil, nil, fmt.Errorf("METRICDATA/INTERNAL-CCMS > TODO: unhandled case: native-scope=%s, requested-scope=%s", nativeScope, requestedScope) } } }