From 6cc9d93d6b2b3591d588c8df92958f8b2228c3e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20S=CC=8Ctibrany=CC=81?= <peter.stibrany@grafana.com>
Date: Thu, 2 Apr 2020 12:43:15 +0200
Subject: [PATCH 1/2] Don't report "object not found" as error for Get/GetRange
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
---
 pkg/objstore/objstore.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pkg/objstore/objstore.go b/pkg/objstore/objstore.go
index 23926054ad..ac870d16ec 100644
--- a/pkg/objstore/objstore.go
+++ b/pkg/objstore/objstore.go
@@ -276,7 +276,9 @@ func (b *metricBucket) Get(ctx context.Context, name string) (io.ReadCloser, err
 
 	rc, err := b.bkt.Get(ctx, name)
 	if err != nil {
-		b.opsFailures.WithLabelValues(getOp).Inc()
+		if !b.bkt.IsObjNotFoundErr(err) {
+			b.opsFailures.WithLabelValues(getOp).Inc()
+		}
 		return nil, err
 	}
 	return newTimingReadCloser(
@@ -292,7 +294,9 @@ func (b *metricBucket) GetRange(ctx context.Context, name string, off, length in
 
 	rc, err := b.bkt.GetRange(ctx, name, off, length)
 	if err != nil {
-		b.opsFailures.WithLabelValues(getRangeOp).Inc()
+		if !b.bkt.IsObjNotFoundErr(err) {
+			b.opsFailures.WithLabelValues(getRangeOp).Inc()
+		}
 		return nil, err
 	}
 	return newTimingReadCloser(

From 53baab8260a23f9d7805d8221dea4091105517e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20S=CC=8Ctibrany=CC=81?= <peter.stibrany@grafana.com>
Date: Thu, 2 Apr 2020 12:59:11 +0200
Subject: [PATCH 2/2] CHANGELOG.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 017ec2e415..9ec45e5662 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
 - [#2254](https://github.com/thanos-io/thanos/pull/2254) Bucket: Fix metrics registered multiple times in bucket replicate
 - [#2271](https://github.com/thanos-io/thanos/pull/2271) Bucket Web: Fixed Issue #2260 bucket passes null when storage is empty
 - [#2339](https://github.com/thanos-io/thanos/pull/2339) Query: fix a bug where `--store.unhealthy-timeout` was never respected
+- [#2365](https://github.com/thanos-io/thanos/pull/2365) .*: don't report "object not found" error as failure via `thanos_objstore_bucket_operation_failures_total` for `get` and `get_range` operations.
 
 ### Added