Graphite: Backend querying improvements (#111549)

This commit is contained in:
Andreas Christou
2025-10-01 15:04:21 +02:00
committed by GitHub
parent bb7358be29
commit ed7163a26f
12 changed files with 1014 additions and 23 deletions
+2 -2
View File
@@ -100,7 +100,7 @@ func (s *Service) CallResource(ctx context.Context, req *backend.CallResourceReq
func (s *Service) createRequest(ctx context.Context, dsInfo *datasourceInfo, params URLParams) (*http.Request, error) {
u, err := url.Parse(dsInfo.URL)
if err != nil {
return nil, err
return nil, backend.DownstreamError(err)
}
if params.SubPath != "" {
@@ -125,7 +125,7 @@ func (s *Service) createRequest(ctx context.Context, dsInfo *datasourceInfo, par
req, err := http.NewRequestWithContext(ctx, method, u.String(), params.Body)
if err != nil {
s.logger.Info("Failed to create request", "error", err)
return nil, fmt.Errorf("failed to create request: %w", err)
return nil, backend.PluginError(fmt.Errorf("failed to create request: %w", err))
}
for k, v := range params.Headers {