clarify ccms logs

This commit is contained in:
Christoph Kluge
2026-03-02 14:10:28 +01:00
parent 3d5a124321
commit 718ff60221
5 changed files with 17 additions and 17 deletions

View File

@@ -339,7 +339,7 @@ func runServer(ctx context.Context) error {
err := metricdispatch.Init(mscfg) err := metricdispatch.Init(mscfg)
if err != nil { if err != nil {
cclog.Debugf("initializing metricdispatch: %v", err) cclog.Debugf("error while initializing external metricdispatch: %v", err)
} else { } else {
haveMetricstore = true haveMetricstore = true
} }

View File

@@ -74,11 +74,11 @@ func Init(rawConfig json.RawMessage) error {
dec := json.NewDecoder(bytes.NewReader(rawConfig)) dec := json.NewDecoder(bytes.NewReader(rawConfig))
dec.DisallowUnknownFields() dec.DisallowUnknownFields()
if err := dec.Decode(&configs); err != nil { 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 { 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 { for _, config := range configs {

View File

@@ -134,7 +134,7 @@ func (ccms *CCMetricStore) buildQueries(
) )
if len(hostQueries) == 0 && len(hostScopes) == 0 { 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...) queries = append(queries, hostQueries...)
@@ -237,7 +237,7 @@ func (ccms *CCMetricStore) buildNodeQueries(
) )
if len(nodeQueries) == 0 && len(nodeScopes) == 0 { 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...) queries = append(queries, nodeQueries...)

View File

@@ -123,7 +123,7 @@ type APIMetricData struct {
Max schema.Float `json:"max"` // Maximum value in time range 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 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. // The token parameter is a JWT used for Bearer authentication; pass empty string if auth is disabled.
func NewCCMetricStore(url string, token string) *CCMetricStore { func NewCCMetricStore(url string, token string) *CCMetricStore {
@@ -356,7 +356,7 @@ func (ccms *CCMetricStore) LoadData(
if len(errors) != 0 { if len(errors) != 0 {
/* Returns list for "partial errors" */ /* 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 return jobData, nil
} }
@@ -514,7 +514,7 @@ func (ccms *CCMetricStore) LoadScopedStats(
if len(errors) != 0 { if len(errors) != 0 {
/* Returns list for "partial errors" */ /* 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 return scopedJobStats, nil
} }
@@ -604,7 +604,7 @@ func (ccms *CCMetricStore) LoadNodeData(
if len(errors) != 0 { if len(errors) != 0 {
/* Returns list of "partial errors" */ /* 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 return data, nil
@@ -765,7 +765,7 @@ func (ccms *CCMetricStore) LoadNodeListData(
if len(errors) != 0 { if len(errors) != 0 {
/* Returns list of "partial errors" */ /* 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 return data, nil

View File

@@ -211,7 +211,7 @@ func (ccms *InternalMetricStore) LoadData(
if len(errors) != 0 { if len(errors) != 0 {
/* Returns list for "partial errors" */ /* 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 return jobData, nil
} }
@@ -260,7 +260,7 @@ func buildQueries(
resolution int64, resolution int64,
) ([]APIQuery, []schema.MetricScope, error) { ) ([]APIQuery, []schema.MetricScope, error) {
if len(job.Resources) == 0 { 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)) queries := make([]APIQuery, 0, len(metrics)*len(scopes)*len(job.Resources))
@@ -531,7 +531,7 @@ func buildQueries(
continue 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 { if len(errors) != 0 {
/* Returns list for "partial errors" */ /* 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 return scopedJobStats, nil
} }
@@ -824,7 +824,7 @@ func (ccms *InternalMetricStore) LoadNodeData(
if len(errors) != 0 { if len(errors) != 0 {
/* Returns list of "partial errors" */ /* 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 return data, nil
@@ -994,7 +994,7 @@ func (ccms *InternalMetricStore) LoadNodeListData(
if len(errors) != 0 { if len(errors) != 0 {
/* Returns list of "partial errors" */ /* 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 return data, nil
@@ -1313,7 +1313,7 @@ func buildNodeQueries(
continue 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)
} }
} }
} }