From 3f23aa2cc7471c717cc0373f9f6836a4b7c90b3f Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Fri, 24 Mar 2017 17:39:51 +0100 Subject: [PATCH] Add headers to indicate remote read/write version Also add Content-Type header. --- storage/remote/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/remote/client.go b/storage/remote/client.go index ee9241d2b..b89e20576 100644 --- a/storage/remote/client.go +++ b/storage/remote/client.go @@ -100,6 +100,8 @@ func (c *Client) Store(samples model.Samples) error { return err } httpReq.Header.Add("Content-Encoding", "snappy") + httpReq.Header.Set("Content-Type", "application/x-protobuf") + httpReq.Header.Set("X-Prometheus-Remote-Write-Version", "0.0.1") ctx, cancel := context.WithTimeout(context.Background(), c.timeout) defer cancel() @@ -146,6 +148,8 @@ func (c *Client) Read(ctx context.Context, from, through model.Time, matchers me if err != nil { return nil, fmt.Errorf("unable to create request: %v", err) } + httpReq.Header.Set("Content-Type", "application/x-protobuf") + httpReq.Header.Set("X-Prometheus-Remote-Read-Version", "0.0.1") ctx, cancel := context.WithTimeout(ctx, c.timeout) defer cancel()