SQL Expressions: Rework backend errors and error instrumentation (#109633)
* Capture error_type label on metrics/traces * Make error messages more helpful to user * Use errutil, categorized errors, and tie them to error_type (category in code) * Misc trace fixes * Add metric to track SQL input conversion
This commit is contained in:
@@ -27,6 +27,7 @@ func ConvertToFullLong(frames data.Frames) (data.Frames, error) {
|
||||
if frames[0].Meta != nil && frames[0].Meta.Type != "" {
|
||||
inputType = frames[0].Meta.Type
|
||||
} else {
|
||||
// shouldn't hit this when calling from handleSqlInput as supportedToLongConversion is called first
|
||||
return nil, fmt.Errorf("input frame missing FrameMeta.Type")
|
||||
}
|
||||
|
||||
@@ -40,6 +41,7 @@ func ConvertToFullLong(frames data.Frames) (data.Frames, error) {
|
||||
case data.FrameTypeTimeSeriesWide:
|
||||
return convertTimeSeriesWideToFullLong(frames)
|
||||
default:
|
||||
// Shouldn't hit this when calling from handleSqlInput as supportedToLongConversion is called first
|
||||
return nil, fmt.Errorf("unsupported input type %s for full long conversion", inputType)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user