mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if httpMethod == "" {
|
||||||
|
httpMethod = http.MethodPost
|
||||||
|
}
|
||||||
|
|
||||||
promClient := client.NewClient(httpClient, httpMethod, settings.URL)
|
promClient := client.NewClient(httpClient, httpMethod, settings.URL)
|
||||||
|
|
||||||
// standard deviation sampler is the default for backwards compatibility
|
// 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 {
|
if err != nil {
|
||||||
return &result, err
|
return &result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
r := s.fetch(ctx, s.client, query, req.Headers)
|
r := s.fetch(ctx, s.client, query, req.Headers)
|
||||||
if r == nil {
|
if r == nil {
|
||||||
s.log.FromContext(ctx).Debug("Received nil response from runQuery", "query", query.Expr)
|
s.log.FromContext(ctx).Debug("Received nil response from runQuery", "query", query.Expr)
|
||||||
|
Loading…
Reference in New Issue
Block a user