mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 12:51:40 +02:00
add more information to existing errors logs and panics
- '$ROOT/$FILE' for better localization in the code - add text where none was given - fix unnecessary sprintf nesting in influxv2 and prometheus metricrepo logging
This commit is contained in:
@@ -92,12 +92,12 @@ func (e *MetricScope) Max(other MetricScope) MetricScope {
|
||||
func (e *MetricScope) UnmarshalGQL(v interface{}) error {
|
||||
str, ok := v.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("enums must be strings")
|
||||
return fmt.Errorf("SCHEMA/METRICS > enums must be strings")
|
||||
}
|
||||
|
||||
*e = MetricScope(str)
|
||||
if !e.Valid() {
|
||||
return fmt.Errorf("%s is not a valid MetricScope", str)
|
||||
return fmt.Errorf("SCHEMA/METRICS > %s is not a valid MetricScope", str)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -303,7 +303,7 @@ func (jm *JobMetric) AddPercentiles(ps []int) bool {
|
||||
|
||||
for _, p := range ps {
|
||||
if p < 1 || p > 99 {
|
||||
panic("invalid percentile")
|
||||
panic("SCHEMA/METRICS > invalid percentile")
|
||||
}
|
||||
|
||||
if _, ok := jm.StatisticsSeries.Percentiles[p]; ok {
|
||||
|
Reference in New Issue
Block a user