From d66130a112251fe146ebfd946efc6d8c424fda4c Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Thu, 1 Oct 2020 23:43:14 +0200 Subject: [PATCH 1/2] Set cortex as user agent for requests Signed-off-by: Julien Pivotto --- CHANGELOG.md | 1 + pkg/configs/client/client.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a0173507b9..691bd839ce5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ * [ENHANCEMENT] Blocksconvert – Builder: retry block upload before giving up. #3245 * [ENHANCEMENT] Hash ring: added instance registered timestamp to the ring. #3248 * [ENHANCEMENT] Reduce tail latency by smoothing out spikes in rate of chunk flush operations. #3191 +* [ENHANCEMENT] User Cortex as User Agent in http requests #3264 * [BUGFIX] No-longer-needed ingester operations for queries triggered by queriers and rulers are now canceled. #3178 * [BUGFIX] Ruler: directories in the configured `rules-path` will be removed on startup and shutdown in order to ensure they don't persist between runs. #3195 * [BUGFIX] Handle hash-collisions in the query path. #3192 diff --git a/pkg/configs/client/client.go b/pkg/configs/client/client.go index da0c1209f17..cc57ad82f6d 100644 --- a/pkg/configs/client/client.go +++ b/pkg/configs/client/client.go @@ -14,6 +14,7 @@ import ( "github.com/go-kit/kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/prometheus/common/version" "github.com/weaveworks/common/instrument" "github.com/cortexproject/cortex/pkg/configs/userconfig" @@ -140,6 +141,8 @@ func doRequest(endpoint string, timeout time.Duration, tlsConfig *tls.Config, si client.Transport = &http.Transport{TLSClientConfig: tlsConfig} } + req.Header.Set("User-Agent", fmt.Sprintf("Cortex/%s", version.Version)) + resp, err := client.Do(req) if err != nil { return nil, err From 22f634fa5a482bfea73dee0144a1e42585f348a4 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Fri, 2 Oct 2020 09:47:01 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md Signed-off-by: Marco Pracucci --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 691bd839ce5..8f9b378ea98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,7 +61,7 @@ * [ENHANCEMENT] Blocksconvert – Builder: retry block upload before giving up. #3245 * [ENHANCEMENT] Hash ring: added instance registered timestamp to the ring. #3248 * [ENHANCEMENT] Reduce tail latency by smoothing out spikes in rate of chunk flush operations. #3191 -* [ENHANCEMENT] User Cortex as User Agent in http requests #3264 +* [ENHANCEMENT] User Cortex as User Agent in http requests issued by Configs DB client. #3264 * [BUGFIX] No-longer-needed ingester operations for queries triggered by queriers and rulers are now canceled. #3178 * [BUGFIX] Ruler: directories in the configured `rules-path` will be removed on startup and shutdown in order to ensure they don't persist between runs. #3195 * [BUGFIX] Handle hash-collisions in the query path. #3192