mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Add error source to data response when prom returns a response (#98144)
add error source to dr when prom returns a response not an error
This commit is contained in:
parent
d935fa1ea0
commit
37e47d5b9a
@ -15,6 +15,7 @@ import (
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/tracing"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data/utils/maputil"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/experimental/status"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
"github.com/grafana/grafana/pkg/promlib/client"
|
||||
@ -300,6 +301,7 @@ func addDataResponse(res *backend.DataResponse, dr *backend.DataResponse) {
|
||||
} else {
|
||||
dr.Error = fmt.Errorf("%v %w", dr.Error, res.Error)
|
||||
}
|
||||
dr.ErrorSource = status.SourceFromHTTPStatus(int(res.Status))
|
||||
dr.Status = res.Status
|
||||
}
|
||||
dr.Frames = append(dr.Frames, res.Frames...)
|
||||
|
Loading…
Reference in New Issue
Block a user