mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
Prometheus: Set httpMethod as POST for new query client when not defined (#77503)
set httpMethod as POST for new query client when not defined
This commit is contained in:
parent
ef7b583169
commit
6b729389b5
@ -64,6 +64,10 @@ func New(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if httpMethod == "" {
|
||||
httpMethod = http.MethodPost
|
||||
}
|
||||
|
||||
promClient := client.NewClient(httpClient, httpMethod, settings.URL)
|
||||
|
||||
// standard deviation sampler is the default for backwards compatibility
|
||||
@ -97,6 +101,7 @@ func (s *QueryData) Execute(ctx context.Context, req *backend.QueryDataRequest)
|
||||
if err != nil {
|
||||
return &result, err
|
||||
}
|
||||
|
||||
r := s.fetch(ctx, s.client, query, req.Headers)
|
||||
if r == nil {
|
||||
s.log.FromContext(ctx).Debug("Received nil response from runQuery", "query", query.Expr)
|
||||
|
Loading…
Reference in New Issue
Block a user