From 317b0cbed25002f915f64fe51b2d3d3173288bb6 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Sat, 27 Feb 2021 13:04:58 +0300 Subject: [PATCH] adds query params for vmalert (#1094) remoteWrite.url now accepts query params at provided url https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1087 --- app/vmalert/remotewrite/remotewrite.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/vmalert/remotewrite/remotewrite.go b/app/vmalert/remotewrite/remotewrite.go index c51be5168..492a7eac6 100644 --- a/app/vmalert/remotewrite/remotewrite.go +++ b/app/vmalert/remotewrite/remotewrite.go @@ -94,7 +94,7 @@ func NewClient(ctx context.Context, cfg Config) (*Client, error) { Timeout: cfg.WriteTimeout, Transport: cfg.Transport, }, - addr: strings.TrimSuffix(cfg.Addr, "/") + writePath, + addr: strings.TrimSuffix(cfg.Addr, "/"), baUser: cfg.BasicAuthUser, baPass: cfg.BasicAuthPass, flushInterval: cfg.FlushInterval, @@ -231,6 +231,7 @@ func (c *Client) send(ctx context.Context, data []byte) error { if c.baPass != "" { req.SetBasicAuth(c.baUser, c.baPass) } + req.URL.Path += writePath resp, err := c.c.Do(req.WithContext(ctx)) if err != nil { return fmt.Errorf("error while sending request to %s: %w; Data len %d(%d)",