Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplication returning deduped and non-deduped results in 0.31.0+ #6257

Closed
diranged opened this issue Apr 3, 2023 · 37 comments · Fixed by #6317
Closed

Deduplication returning deduped and non-deduped results in 0.31.0+ #6257

diranged opened this issue Apr 3, 2023 · 37 comments · Fixed by #6317

Comments

@diranged
Copy link

diranged commented Apr 3, 2023

Thanos, Prometheus and Golang version used:

Thanos Version: 0.31.0
Prometheus Version: 2.42.0

Object Storage Provider:

S3

What happened:

Slack Thread: https://cloud-native.slack.com/archives/CK5RSSC10/p1680534545839619

We recently upgraded Thanos from v0.28.1 to v0.31.0… and we’re seeing some odd behavior now with portions of our queries. Basically queries that pull data from the last few hours are all correct. However, longer queries will return duplicate data as long as “use deduplication” is checked (which has been the default setting forever). The really weird part is if we uncheck that box, we suddenly get the right data.

We have the following CLI flags configured on our thanos-query pods:

            - --query.replica-label=replica
            - --query.replica-label=prometheus_replica
            - --query.replica-label=cluster
            - --query.replica-label=__replica__
            - --query.replica-label=tenant_id
            - --query.replica-label=receive
            - --query.replica-label=prometheus
            - --query.replica-label=thanos_ruler_replica
            - --query.auto-downsampling
            - --query.max-concurrent-select=25
            - --store.response-timeout=1m
            - --query.max-concurrent=500
            - --query.metadata.default-time-range=6h

image
image

What you expected to happen:

I expect to get the right results as happened in the 0.28.0, 0.29.0, 0.30.0, 0.30.2 releases.

Anything else we need to know:

After discovering the issue, we rolled back to 0.28.0 and then upgraded one release at a time... the problem only occurs when we upgrade to the 0.31.0 release.

@fpetkovski
Copy link
Contributor

This is likely introduced in #5988.

Do you know which component returns non deduplicated results, and are all Thanos components updated to 0.31? Also, are all replica labels external labels, or are some of them stored inside TSDBs are series labels?

@diranged
Copy link
Author

diranged commented Apr 3, 2023

All of the components are running 0.31.0 when the problem happens. I believe some of the labels are stored inside TSDBs because they are coming from our prometheus scraper pods (which push into the receive pods) - but I'm not totally sure.

@fpetkovski
Copy link
Contributor

@GiedriusS maybe we should strip replica labels from series as well?

@zhangrj
Copy link

zhangrj commented Apr 4, 2023

same problem here: #6248

@zhangrj
Copy link

zhangrj commented Apr 4, 2023

This is likely introduced in #5988.

Do you know which component returns non deduplicated results, and are all Thanos components updated to 0.31? Also, are all replica labels external labels, or are some of them stored inside TSDBs are series labels?

according to my test, it's storegateway (I'm not sure whether ruler has this problem)

@fpetkovski
Copy link
Contributor

@zhangrj do you have any replica labels that are stored in TSDB and are not external labels?

@zhangrj
Copy link

zhangrj commented Apr 6, 2023

@zhangrj do you have any replica labels that are stored in TSDB and are not external labels?

sorry, I don't have.

@amro-krg
Copy link

Same issue here, instantly fixed after a rollback to 0.30.2

Very strange indeed. I have 2 prometheuses and replica-label is set.
In Thanos-query, this query:
myquery{instance="10.0.0.1"} returns 1 series only, all good
myquery{instance="10.0.0.2"} also returns 1 series
However, myquery{instance=~"10.0.0.*"} doesn't return 2 series as it should, but 4! And they have the EXACT same labels 2 by 2. If I disable deduplication I can see the different prometheus_replica.

Thanos-query seems to have trouble merging different series based on replica-label, but only when the query returns more than one series.

@GiedriusS
Copy link
Member

Do you use Thanos Receive? Also, could you please print the list of series verbatim with all of their labels like you see them on Thanos Query with deduplication off?

@amro-krg
Copy link

amro-krg commented Apr 13, 2023

Yes, we use Thanos Receive and Thanos Store, and the problem does indeed come from Receive. Take a look:
Query1:
node_os_info{instance=~"hulbdcfr1-00(1|2).*"} with deduplication off:


node_os_info{env="production", id="centos", id_like="rhel fedora", instance="hulbdcfr1-001.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}
node_os_info{env="production", id="centos", id_like="rhel fedora", instance="hulbdcfr1-002.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}
node_os_info{env="production-nl1", id="centos", id_like="rhel fedora", instance="hulbdcfr1-001.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}
node_os_info{env="production-nl1", id="centos", id_like="rhel fedora", instance="hulbdcfr1-002.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}

same query with deduplication on:


node_os_info{id="centos", id_like="rhel fedora", instance="hulbdcfr1-001.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}
node_os_info{id="centos", id_like="rhel fedora", instance="hulbdcfr1-001.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}
node_os_info{id="centos", id_like="rhel fedora", instance="hulbdcfr1-002.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}
node_os_info{id="centos", id_like="rhel fedora", instance="hulbdcfr1-002.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}

You can see these metrics are doubled, and have the exact same labels.

Query 2: Another query for one specific node only, without deduplication:
node_os_info{instance=~"hulbdcfr1-001.*"}

node_os_info{env="production", id="centos", id_like="rhel fedora", instance="hulbdcfr1-001.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}
node_os_info{env="production-nl1", id="centos", id_like="rhel fedora", instance="hulbdcfr1-001.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}

and with deduplication:

node_os_info{id="centos", id_like="rhel fedora", instance="hulbdcfr1-001.REDACTED:9106", job="Node Exporter", name="CentOS Linux", pretty_name="CentOS Linux 7 (Core)", receive_cluster="eu1", receive_replica="0", tenant_id="default-tenant", version="7 (Core)", version_id="7"}

With this last one, Thanos-query does indeed merge as it's supposed to.

Again, just rolling back from 0.31.0 to 0.30.2 and redeploying without changing 1 byte, solves the problem :/

@fpetkovski
Copy link
Contributor

fpetkovski commented Apr 13, 2023

Do you happen to have prometheus HA pairs that both remote write to Receivers? Trying to understand where the prometheus_replica label is coming from.

@GiedriusS
Copy link
Member

@GiedriusS maybe we should strip replica labels from series as well?

I wonder if this could be the culprit. I'll try to reproduce but I haven't been able so far.

@amro-krg
Copy link

@fpetkovski yes, 2 prometheuses with exact same targets (no sharding or whatsoever) are remote_writing to thanos receive:

  remote_write:
    - url: http://xx.xx.xx.xx:10908/api/v1/receive

where 10908 is given to thanos-receive as arg --remote-write.address 0.0.0.0:10908

One prometheus is set with

    external_labels:
      env: production

and the other

    external_labels:
      env: production-nl1

and of course, thanos-query as:
--query.replica-label=env

@fpetkovski
Copy link
Contributor

fpetkovski commented Apr 14, 2023

@amro-krg you are running into #6257 (comment).

In #5988 we made an optimization which improves query performance by deduplicating on external labels only. Even though prometheus_replica is an external label in Prometheus, it is remote written into a Receiver TSDB. Each receivers in your case has two prometheus_replica values in its TSDB and this is why deduplication fails.

@diranged This could explain the issue you are seeing as well if you have some sort of HA scraping + remote write setup.

Link to the proposal: https://github.com/thanos-io/thanos/blob/main/docs/proposals-accepted/20221129-avoid-global-sort.md.

@hagaibarel
Copy link

Hitting the same issue as @amro-krg with a similar setup, prometheus writes to receive via remote write and query returning deduped and non-deduped results with prometheus_replica label.

Any suggestions on workaround or how to handle this?

@fpetkovski
Copy link
Contributor

I don't know a way to mitigate this issue right now. Writing to Receivers with HA prometheus pairs is not something we predicted as a potential use case.

KubeCon EU is happening next week so it will be a good opportunity for us to look into solutions. We will probably need to cut 0.31.1 once we have a fix.

@trevorriles
Copy link

We are seeing this same issue without receive in the picture.

We've since rolled back but I can try and reproduce again in a dev environment next week.

We just have Prometheus + sidecar, store, and ruler. All behind the query servers.

@fpetkovski
Copy link
Contributor

@trevorriles that would be great, especially if you can share which replica labels you use and what the incorrect query result looks like.

@wallee94
Copy link
Contributor

I believe this comes from the stores not re-ordering the series after adding the external labels. You can replicate it by adding the metrics:

metric{}
metric{alocal="label"}

And an external label ext="label". Before the external label, metric{} < metric{alocal="label"} because it has fewer labels. However, after adding it, both sidecar and ruler returned this when I tested them:

metric{ext="label"}
metric{alocal="label", ext="label"}

and since alocal < ext, the order is incorrect. If we have two stores returning the same duplicated data, ProxyResponseHeap will yield the following:

metric{ext="label"}
metric{alocal="label", ext="label"}
metric{ext="label"}
metric{alocal="label", ext="label"}

Making dedupResponseHeap ignore the duplication. I tried to work out a solution in the ProxyResponseHeap Less function, but I think this should probably be re-sorted in the stores instead. The same incorrect order is in prometheus remote read response to the sidecar

@fpetkovski
Copy link
Contributor

I think you are right, this could be one way the issue could happen. We should probably exclude external labels from the comparison because they interfere with the sorting order.

@fpetkovski
Copy link
Contributor

fpetkovski commented Apr 24, 2023

I think there are two separate problems here. The first one is that external labels can affect the ordering of series coming from tsdb. This one could potentially be fixed by #6299.

The second problem is deduplicating by labels which are stored inside the tsdb and are not external labels. In this case, removing replica labels will lead to unsorted data. This scenario can happen when two HA prometheus instances write into a receiver. I do not see a way to fix this other than to introduce a flag in the querier (e.g. dedup-by-internal-labels) to tell it that it should resort the data before deduplication.

@GiedriusS
Copy link
Member

IMO having yet another flag for that would be a mess and it would be hard to explain to users whether it is needed or not. Would there be any downsides to removing given labels from the response regardless of whether they are external labels? With deduplication, the replica labels disappear either way.

@fpetkovski
Copy link
Contributor

fpetkovski commented Apr 24, 2023

This will not solve the problem, we can have a single store response like:

metric{replica="a", z="1"}
metric{replica="a", z="2"}
metric{replica="b", z="1"}
metric{replica="b", z="2"}

If we dedup by replica and we strip it from the response, we end up with an unsorted series set:

metric{z="1"}
metric{z="2"}
metric{z="1"}
metric{z="2"}

Also, we already do this:

completeLabelset := labelpb.ExtendSortedLabels(rmLabels(series.Labels(), extLsetToRemove), finalExtLset)

Alternatively we can detect if dedup labels are replica labels everywhere, and avoid resorting in that case. However, then we need to set the same replica label in all stores if we want to avoid the resort.

@fpetkovski
Copy link
Contributor

fpetkovski commented Apr 25, 2023

@GiedriusS wdyt about a solution that uses bloom filters to detect dedup by internal labels: #6317.

I haven't tested this in a staging environment to see how much memory/bandwidth overhead we would have, but I can do that next week once I am back in the office. It could also open the door to additional bloom filters (e.g. on metric names).

@douglascamata
Copy link
Contributor

@fpetkovski @GiedriusS @bwplotka: I know that #5988 is a huge PR that introduces a lot of changes... but this bug is kind of critical for anyone running the. 0.31.0 release. Given I see it'll take some time to fix it, would it be better to try to make the behavior introduced by #5988 be behind an experimental flag until the fix is done? WDYT?

@GiedriusS
Copy link
Member

Got some time to think about this and fix it so hopefully this will get done soon.

@GiedriusS
Copy link
Member

To recap: dedup used to work by saving all storepb.SeriesResponse into a slice and then resorting everything so that series would be sorted by replica labels first.
In 0.31.0 we added withoutReplicaLabels as per the proposal: https://thanos.io/tip/proposals-accepted/20221129-avoid-global-sort.md/. The idea was to remove replica labels before getting the response so that we could use k-way merge to merge everything in order.

However, we missed that a StoreAPI might start sending unsorted responses with this functionality. Consider the following:

a=1,b=1
a=1,b=2
a=2,b=1
a=2,b=2

If the replica label is a then the response becomes:

b=1
b=2
b=1
b=2

Because storage.SeriesSet is an iterator over a sorted series set, it means that to have lazy, in order evaluation of the iterator we'd need to buffer everything that comes between the two b=1 series in the response from a StoreAPI.

If a is an external label then the situation changes a bit. This means that the response would look like:

a=1,b=1
a=1,b=2
a=1,b=1
a=1,b=2

Since external labels always have the same value, it means that such a response is not possible and it would look something like this instead:

a=1,b=1,c=1
a=1,b=2,c=1
a=1,b=1
a=1,b=2

Deduplication on external labels makes it so that even with the removal of the external label, the response is sorted and we can use k-way merge directly.

This is the difference between deduplication on internal labels and external labels. Due to this, it seems like we would inevitably have to buffer everything to provide a general deduplication algorithm. But, we should avoid buffering as much as possible. The small ad-hoc benchmark in the original proposal shows a huge performance improvement.

Thus, my suggestion would be to:

  • If deduplication works on internal labels (or internal+external labels) then we have to buffer + resort;
  • If deduplication works only on external labels then everything can stay as is.

I also suggest removing this #6257 (comment) hack because a StoreAPI must always send a sorted series set. If it doesn't then that's a bug in the StoreAPI implementation.

I filled #6563 and prometheus/prometheus#12605 for these bugs. But these are other problems impacting deduplication since the beginning of Thanos, I think. So, let's fix the original problem first.

@fpetkovski
Copy link
Contributor

Thus, my suggestion would be to:

If deduplication works on internal labels (or internal+external labels) then we have to buffer + resort;
If deduplication works only on external labels then everything can stay as is.

Can we then adapt #6317 to resort in stores instead of doing it in the querier?

@gkope
Copy link

gkope commented Aug 4, 2023

issue was happening here as well with prometheus v2.45.0 and thanos on v.0.31.0

Im using a model with observer/observee clusters. My observee clusters prometheus don't have thanos sidecar, so I scrap the /federate of this prometheus with my prometheus-thanos from the observer cluster. When I have 2 replicas in my prometheus-thanos i get sometimes the duplicated labelset error, sometimes we got a empty result.

we rollback to thanos version 0.30.0 and everythink works fine now.

@ahurtaud
Copy link
Contributor

Can confirm fix is working in our setup. Thank you @fpetkovski !

@benjaminhuo
Copy link
Contributor

Cannot wait any longer for a new release that includes this fix!
Thanks, @fpetkovski

GiedriusS added a commit that referenced this issue Aug 11, 2023
Document the why/what from
#6257 in the Querier
documentation.

Signed-off-by: Giedrius Statkevičius <[email protected]>
GiedriusS added a commit that referenced this issue Aug 11, 2023
Document the why/what from
#6257 in the Querier
documentation.

Signed-off-by: Giedrius Statkevičius <[email protected]>
harsh-ps-2003 pushed a commit to harsh-ps-2003/thanos that referenced this issue Aug 22, 2023
Document the why/what from
thanos-io#6257 in the Querier
documentation.

Signed-off-by: Giedrius Statkevičius <[email protected]>
subbarao-meduri added a commit to stolostron/thanos that referenced this issue Sep 7, 2023
* Updates busybox SHA (#6283)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Upgrade prometheus to 7309ac272195cb856b879306d6a27af7641d3346 (#6287)

* Upgrade prometheus to 7309ac272195cb856b879306d6a27af7641d3346

Signed-off-by: Alex Le <[email protected]>

* Reverted test code

Signed-off-by: Alex Le <[email protected]>

* Updated comment

Signed-off-by: Alex Le <[email protected]>

* docs: mismatch in changelog

Signed-off-by: Etienne Martel <[email protected]>
Signed-off-by: Alex Le <[email protected]>

* Updates busybox SHA (#6283)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>
Signed-off-by: Alex Le <[email protected]>

* trigger workflow

Signed-off-by: Alex Le <[email protected]>

* trigger workflow

Signed-off-by: Alex Le <[email protected]>

---------

Signed-off-by: Alex Le <[email protected]>
Signed-off-by: Etienne Martel <[email protected]>
Signed-off-by: GitHub <[email protected]>
Co-authored-by: Etienne Martel <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: fpetkovski <[email protected]>

* Add CarTrade Tech as new adopter

Signed-off-by: naveadkazi <[email protected]>

* sort ProxyResponseHeap comparing only diff labels

Signed-off-by: Walther Lee <[email protected]>

* proxy heap: remove store labels before comparing response series

Signed-off-by: Walther Lee <[email protected]>

* tests: Remove custom Between test matcher (#6310)

* Remove custom Between test matcher

The upstream PR to efficientgo/e2e has been merged, so we can use  it from there.

Signed-off-by: Douglas Camata <[email protected]>

* Run go mod tidy

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>

* Remove testingRespSet and update comparison func

Signed-off-by: Walther Lee <[email protected]>

* Fix tests

Signed-off-by: Walther Lee <[email protected]>

* query frontend, query UI: Native histogram support (#6071)

* Implemented native histogram support for qfe and query UI

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed marshalling for histograms in qfe

Started working on native histogram query ui

Copied histogram implementation for graph

Added query range support for native histograms in qfe

Use prom model (un-)marshal for native histograms in qfe

Use prom model (un-)marshal for native histograms in qfe

Fixed sample and sample stream marshal fn

Extended qfe native histogram e2e tests

Added copyright to qfe queryrange compat

Added query range test fo histograms and try to fix ui tests

Fixed DataTable test

Review feedback

Fixed native histogram e2e test

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Add histogram support for ApplyCounterResetsSeriesIterator

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Made assets

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Add chnagelog

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed changelog

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed qfe

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed PrometheusResponse minTime for histograms in qfe

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Updated prometheus common to v0.40.0 and queryrange.Sample fixes

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Updated Readme

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Addressed PR comments

Signed-off-by: Sebastian Rabenhorst <[email protected]>

trigger tests

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Made assets

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Made assets

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* fixed tsdbutil references

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* fixed imports

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Enabled pushdown for query native hist test and removed ToDo

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Refactored native histogram query UI

Signed-off-by: Sebastian Rabenhorst <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* store: add streamed snappy encoding for postings list (#6303)

* store: add streamed snappy encoding for postings list

We've noticed that decoding Snappy compressed postings list
takes a lot of RAM:

```
(pprof) top
Showing nodes accounting for 1427.30GB, 67.55% of 2112.82GB total
Dropped 1069 nodes (cum <= 10.56GB)
Showing top 10 nodes out of 82
      flat  flat%   sum%        cum   cum%
         0     0%     0%  1905.67GB 90.20%  golang.org/x/sync/errgroup.(*Group).Go.func1
    2.08GB 0.098% 0.098%  1456.94GB 68.96%  github.com/thanos-io/thanos/pkg/store.(*blockSeriesClient).ExpandPostings
    1.64GB 0.078%  0.18%  1454.87GB 68.86%  github.com/thanos-io/thanos/pkg/store.(*bucketIndexReader).ExpandedPostings
    2.31GB  0.11%  0.29%  1258.15GB 59.55%  github.com/thanos-io/thanos/pkg/store.(*bucketIndexReader).fetchPostings
    1.48GB  0.07%  0.36%  1219.67GB 57.73%  github.com/thanos-io/thanos/pkg/store.diffVarintSnappyDecode
 1215.21GB 57.52% 57.87%  1215.21GB 57.52%  github.com/klauspost/compress/s2.Decode
```

This is because we are creating a new []byte slice for the decoded data
each time. To avoid this RAM usage problem, let's stream the decoding
from a given buffer. Since Snappy block format doesn't support streamed
decoding, let's switch to Snappy stream format which is made for exactly
that.

Notice that our current `index.Postings` list does not
support going back through Seek() even if theoretically one could want
something like that. Fortunately, to search for posting intersection, we
need to only go forward.

Benchmark data:

```
name                                                          time/op
PostingsEncodingDecoding/10000/raw/encode-16                  71.6µs ± 3%
PostingsEncodingDecoding/10000/raw/decode-16                  76.3ns ± 4%
PostingsEncodingDecoding/10000#01/snappy/encode-16            73.3µs ± 1%
PostingsEncodingDecoding/10000#01/snappy/decode-16            1.63µs ± 6%
PostingsEncodingDecoding/10000#02/snappyStreamed/encode-16     111µs ± 2%
PostingsEncodingDecoding/10000#02/snappyStreamed/decode-16    14.5µs ± 7%
PostingsEncodingDecoding/100000/snappyStreamed/encode-16      1.09ms ± 2%
PostingsEncodingDecoding/100000/snappyStreamed/decode-16      14.4µs ± 4%
PostingsEncodingDecoding/100000#01/raw/encode-16               710µs ± 1%
PostingsEncodingDecoding/100000#01/raw/decode-16              79.3ns ±13%
PostingsEncodingDecoding/100000#02/snappy/encode-16            719µs ± 1%
PostingsEncodingDecoding/100000#02/snappy/decode-16           13.5µs ± 4%
PostingsEncodingDecoding/1000000/raw/encode-16                7.14ms ± 1%
PostingsEncodingDecoding/1000000/raw/decode-16                81.7ns ± 9%
PostingsEncodingDecoding/1000000#01/snappy/encode-16          7.52ms ± 3%
PostingsEncodingDecoding/1000000#01/snappy/decode-16           139µs ± 4%
PostingsEncodingDecoding/1000000#02/snappyStreamed/encode-16  11.4ms ± 4%
PostingsEncodingDecoding/1000000#02/snappyStreamed/decode-16  15.5µs ± 4%

name                                                          alloc/op
PostingsEncodingDecoding/10000/raw/encode-16                  13.6kB ± 0%
PostingsEncodingDecoding/10000/raw/decode-16                   96.0B ± 0%
PostingsEncodingDecoding/10000#01/snappy/encode-16            25.9kB ± 0%
PostingsEncodingDecoding/10000#01/snappy/decode-16            11.0kB ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/encode-16    16.6kB ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/decode-16     148kB ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/encode-16       148kB ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/decode-16       148kB ± 0%
PostingsEncodingDecoding/100000#01/raw/encode-16               131kB ± 0%
PostingsEncodingDecoding/100000#01/raw/decode-16               96.0B ± 0%
PostingsEncodingDecoding/100000#02/snappy/encode-16            254kB ± 0%
PostingsEncodingDecoding/100000#02/snappy/decode-16            107kB ± 0%
PostingsEncodingDecoding/1000000/raw/encode-16                1.25MB ± 0%
PostingsEncodingDecoding/1000000/raw/decode-16                 96.0B ± 0%
PostingsEncodingDecoding/1000000#01/snappy/encode-16          2.48MB ± 0%
PostingsEncodingDecoding/1000000#01/snappy/decode-16          1.05MB ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/encode-16  1.47MB ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/decode-16   148kB ± 0%

name                                                          allocs/op
PostingsEncodingDecoding/10000/raw/encode-16                    2.00 ± 0%
PostingsEncodingDecoding/10000/raw/decode-16                    2.00 ± 0%
PostingsEncodingDecoding/10000#01/snappy/encode-16              3.00 ± 0%
PostingsEncodingDecoding/10000#01/snappy/decode-16              4.00 ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/encode-16      4.00 ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/decode-16      5.00 ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/encode-16        4.00 ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/decode-16        5.00 ± 0%
PostingsEncodingDecoding/100000#01/raw/encode-16                2.00 ± 0%
PostingsEncodingDecoding/100000#01/raw/decode-16                2.00 ± 0%
PostingsEncodingDecoding/100000#02/snappy/encode-16             3.00 ± 0%
PostingsEncodingDecoding/100000#02/snappy/decode-16             4.00 ± 0%
PostingsEncodingDecoding/1000000/raw/encode-16                  2.00 ± 0%
PostingsEncodingDecoding/1000000/raw/decode-16                  2.00 ± 0%
PostingsEncodingDecoding/1000000#01/snappy/encode-16            3.00 ± 0%
PostingsEncodingDecoding/1000000#01/snappy/decode-16            4.00 ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/encode-16    4.00 ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/decode-16    5.00 ± 0%
```

Compression ratios are still the same like previously:

```
$ /bin/go test -v -timeout 10m -run ^TestDiffVarintCodec$ github.com/thanos-io/thanos/pkg/store
[snip]
=== RUN   TestDiffVarintCodec/snappy/i!~"2.*"
    postings_codec_test.go:73: postings entries: 944450
    postings_codec_test.go:74: original size (4*entries): 3777800 bytes
    postings_codec_test.go:80: encoded size 44498 bytes
    postings_codec_test.go:81: ratio: 0.012
=== RUN   TestDiffVarintCodec/snappyStreamed/i!~"2.*"
    postings_codec_test.go:73: postings entries: 944450
    postings_codec_test.go:74: original size (4*entries): 3777800 bytes
    postings_codec_test.go:80: encoded size 44670 bytes
    postings_codec_test.go:81: ratio: 0.012
```

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: clean up postings code

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: fix estimation

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: use buffer.Bytes()

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store/postings_codec: reuse extgrpc compressors/decompressors

Signed-off-by: Giedrius Statkevičius <[email protected]>

* CHANGELOG: add item

Signed-off-by: Giedrius Statkevičius <[email protected]>

* CHANGELOG: clean up whitespace

Signed-off-by: Giedrius Statkevičius <[email protected]>

---------

Signed-off-by: Giedrius Statkevičius <[email protected]>

* compact: atomically replace no compact marked map (#6319)

With lots of blocks it could take some time to fill this no compact
marked map hence replace it atomically. I believe this leads to problems
in the compaction planner where it picks up no compact marked blocks
because meta syncer does synchronizations concurrently.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Reuse buffers for label comparison

Signed-off-by: Filip Petkovski <[email protected]>

* Use len instead of cap

Signed-off-by: Filip Petkovski <[email protected]>

* Use len instead of cap

Signed-off-by: Filip Petkovski <[email protected]>

* Fixed Jaeger exporter specification link (#6324)

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* receive: Make max backoff configurable (#6163)

Signed-off-by: Philip Gough <[email protected]>

* Replace summary in extprom metrics with histogram (#6327)

* Replaced summary in extprom metrics with histogram

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Added changelog

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Removed unused parameters from NewInstrumentationMiddleware

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Reverted NewInstrumentationMiddleware

Signed-off-by: Sebastian Rabenhorst <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Expose info for each TSDB

This commit exposes the label set alongside the min and max time
for each TSDB covered by a Store.

This information is used to scope the min time for a remote query
so that we do not produce partial aggregates in distriuted mode.

Signed-off-by: Filip Petkovski <[email protected]>

* Add test case for proxy store

Signed-off-by: Filip Petkovski <[email protected]>

* Pass engine factory by reference

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Cleanup

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Use NewQueryEngineFactory in tests

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Avoid expensive log.Valuer evaluation for disallowed levels (#6322)

Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>

* Fix inconsistent error for series limits in Store API (#6330)

* store: fix inconsistent error for series limits

Signed-off-by: Thibault Mange <[email protected]>

* update changelog

Signed-off-by: Thibault Mange <[email protected]>

* Update pkg/store/bucket.go

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Thibault Mange <[email protected]>

* Update pkg/store/bucket.go

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Thibault Mange <[email protected]>

* rename labelValues serires liimiter test function

Signed-off-by: Thibault Mange <[email protected]>

---------

Signed-off-by: Thibault Mange <[email protected]>
Co-authored-by: Saswata Mukherjee <[email protected]>

* *: remove unmaintained gzip library (#6332)

Switch from nytimes gzip library to the klaustpost's gzip code. The old
gzip HTTP handler shows up a lot in allocs so that's how I ended up
doing this change.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Traces sampler env var (#6306)

* Issue#5947 OTEL_TRACES_SAMPLER env var

Signed-off-by: shayyxi <[email protected]>

* Test correction

Signed-off-by: shayyxi <[email protected]>

* doc failure correction. parse float argument correction.

Signed-off-by: shayyxi <[email protected]>

* added the changelog.

Signed-off-by: shayyxi <[email protected]>

* ran make docs to fix the build failure.

Signed-off-by: shayyxi <[email protected]>

* corrected the incorrect change in tools.md

Signed-off-by: shayyxi <[email protected]>

* fixed review comments.

Signed-off-by: shayyxi <[email protected]>

---------

Signed-off-by: shayyxi <[email protected]>
Signed-off-by: Shazi <[email protected]>
Co-authored-by: shayyxi <[email protected]>

* query: use storepb.SeriesServer (#6334)

Use storepb.SeriesServer instead of the concrete struct. This allows
implementing functionality on top of the proxy.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* cacheutil: upgrade `rueidis` to v1.0.2 to improve error handling while shrinking a redis cluster. https://github.com/redis/rueidis/issues/209 (#6342)

* use github.com/onsi/gomega/gleak to detect goroutine leak with timeout

Signed-off-by: Rueian <[email protected]>

* fix: spelling errors DoInSpanWtihErr to DoInSpanWithErr (#6345)

Signed-off-by: aimuz <[email protected]>

* Return grpc code resource exhausted for byte limit error (#6325)

* return grpc code resource exhausted for byte limit error

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* update partial response strategy

Signed-off-by: Ben Ye <[email protected]>

* fix limit

Signed-off-by: Ben Ye <[email protected]>

* try to fix tests

Signed-off-by: Ben Ye <[email protected]>

* fix test error message

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Bump promql-engine to fix https://github.com/thanos-community/promql-engine/issues/239 (#6349)

Signed-off-by: Alban HURTAUD <[email protected]>

* Optimize generating store match reason (#6355)

Removes reason generation when debug logging is not enabled.

Signed-off-by: Filip Petkovski <[email protected]>

* Updates busybox SHA (#6365)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Query: Add +Inf bucket to query duration metrics  (#6358)

* Query: Add +Inf bucket to query duration metrics

For the query duration metrics
(`thanos_store_api_query_duration_seconds`), we record query respond
latency, based on the size of the query (samples/series), and save to a
histogram.

However, when a query is made which exceeds the biggest sample/serie
size, we would prior to this commit, put the request into the largest
bucket.

With this commit, we instead create an `+Inf` bucket, and put requests
which are larger than the biggest defined bucket into that. This gives
more accurate results, and also allow one to see if the bucket sizes are
incorrectly sized.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Tests: Mutex around non-thread safe random source

When creating test blocks, we use a non-thread safe random source, in
multiple goroutines. Due to this, tests would sometime panic.

This commits puts a mutex around calls using the same source, in order
to avoid this.

This should hopefully improve reliability of e2e tests.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

---------

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Check context when expanding postings (#6363)

* check context when expanding postings

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* ui: only keep name in store_matches param (#6371)

We are doing store matching on the `name` field hence only keep that
field in the URL because otherwise the URL could get quite lengthy with
external labelsets inside of it.

Besides unit tests, I have also tested locally:
- Enable store filtering;
- Select store(-s);
- Copy/paste URL into the new tab and see that the same stores are
  loaded like expected;
- See that URL only has names in them.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* docs: replace --store with --endpoint

Replace deprecated `--store` with `--endpoint` in docs.

Signed-off-by: Paul Gier <[email protected]>

* Optimizing "grafana generated" regex matchers (#6376)

* Opmizing Group Regex

Signed-off-by: Alan Protasio <[email protected]>

* fixing native histogram tests

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Cache: various index cache client improvements (#6374)

* e2e(query): Reproduce dedup issue from #6257

Signed-off-by: Douglas Camata <[email protected]>

* Add dedup e2e test for Receive

With internal and external labels support.

Signed-off-by: Douglas Camata <[email protected]>

* Simplify generated blocks for query test

Signed-off-by: Douglas Camata <[email protected]>

* Improve query dedup test

Signed-off-by: Douglas Camata <[email protected]>

* Write a query test for dedup with sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Refactor query dedup test with sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Fix Receive query test

Now it properly ensures the double dedup works (on internal and external labels).

Signed-off-by: Douglas Camata <[email protected]>

* Fix receive drawing

Signed-off-by: Douglas Camata <[email protected]>

* Add one extra test caes for query dedup from store

Signed-off-by: Douglas Camata <[email protected]>

* Complement test for Receive query with dedup

Signed-off-by: Douglas Camata <[email protected]>

* Complement test for Sidecar query dedup

Signed-off-by: Douglas Camata <[email protected]>

* Query Explanation (#6346)

* Return Query Explaination in QueryAPI

A param `explain` is added to QueryAPI, if true then explanation
returned by the `Explain()` method of the query having structure
`ExplainOutputNode` is returned in response.
Query Explanation is added under new field in response that is
`thanosInfo`.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add explain checkbox in thanos UI

A explain checkbox is added to Thanos Query UI, that requests for
query explanation from thanos query api.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add ExpandableNode Component

ExpandableNode component renders Query Explanation in the thanos
UI. Requires a new package `react-accessible-treeview`.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Disable Explain checkbox on prometheus engine

Prometheus engine sends out error if toggle explain button. To
provide better experience, the explain checkbox get disbaled on
switching to prometheus engine and enable back on switching to
thanos engine.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add alert box with horizontal scrolling for Explanation

Signed-off-by: Pradyumna Krishna <[email protected]>

* Remove ExpandableNode and Add ListTree

Updates the design for query explanation box, removes
`ExpandableNode` and the dependency. Builts a new `ListTree` that
does the same using reactstrap and custom css.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor refactor in Query API response

`thanosInfo` is removed from Query reponse and used `explanation`
directly. `disableCheckbox` is also renamed to
`disableExplainCheckbox` in thanos UI.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update UI tests to passing

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor UI changes and test fix

UI improvements and Panel test fix other way around, resetting
the results on panel construction.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update promql-engine to use Explain method

Signed-off-by: Pradyumna Krishna <[email protected]>

* Build UI assets

Build UI assets, that runs new thanos UI with explain button.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Revert proxy url change from package.json

`proxy` was accidently changed and committed with package.json
when removed dependency. Hence, reverting it back.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor changes in UI

Fix requested changes in UI.
- Rename `state` and `setState` to `mapping` and `setMapping`.
- Rename `NodeTree` to `QueryTree`.
- Use unicode characters instead of `-` and `+`.
- Fix blue box on explain button.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update UI assets

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* Implementing Regex optimization on the `MatchNotRegexp` and `MatchNotEqual` matcher type (#6379)

* Implementing Regex optimization on the MatchNotRegexp matcher type

Signed-off-by: Alan Protasio <[email protected]>

* Opmizing MatchNotEqual

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Expected failure of block label query dedup tests

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Put back the correct makefile

Signed-off-by: Douglas Camata <[email protected]>

* add de-cix as adopter (#6386)

Signed-off-by: Raul Garcia Sanchez <[email protected]>

* Remove extra line that broke untouched test

Signed-off-by: Douglas Camata <[email protected]>

* Add back line break at end of makefile

Signed-off-by: Douglas Camata <[email protected]>

* Fix Receive single ingestor test

Signed-off-by: Douglas Camata <[email protected]>

* Reproduce dedup issue in Receive

Signed-off-by: Douglas Camata <[email protected]>

* Add even more test cases for dedup on store gw

Signed-off-by: Douglas Camata <[email protected]>

* Reproduce dedup bug in Sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Reuse nginx image name

Signed-off-by: Douglas Camata <[email protected]>

* Let all users read the metrics file from static metrics server

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* [chore] Updating Query Engine and Prometheus (#6392)

* Updating Query Engine

Signed-off-by: Alan Protasio <[email protected]>

* fix prometheus breaking change

Signed-off-by: Alan Protasio <[email protected]>

* Update prometheus with https://github.com/prometheus/prometheus/pull/12387

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Receive: Allow specifying tenant-specific external labels in RouterIngestor (#5777)

Signed-off-by: haanhvu <[email protected]>

* check context cancel when doing posting batches (#6396)

Signed-off-by: Ben Ye <[email protected]>

* Expose store gateway query stats in series response hints (#6352)

* expose query stats hints

Signed-off-by: Ben Ye <[email protected]>

* update

Signed-off-by: Ben Ye <[email protected]>

* add query stats hints in result

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* add merge method

Signed-off-by: Ben Ye <[email protected]>

* fix unit test

Signed-off-by: Ben Ye <[email protected]>

modify hints proto

Signed-off-by: Ben Ye <[email protected]>

fix unit test

Signed-off-by: Ben Ye <[email protected]>

update format

Signed-off-by: Ben Ye <[email protected]>

* update comments

Signed-off-by: Ben Ye <[email protected]>

* try again

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* receive: make az aware ketama hashring (#6369)

* receive: make az aware ketama hashring

Signed-off-by: Alexander Rickardsson <[email protected]>

* receive: pass endpoints in hashring config as object

Signed-off-by: Michael Hoffmann <[email protected]>

* receive: add some tests for consistent hashing in presence of AZs

Signed-off-by: Michael Hoffmann <[email protected]>

* receive,docs: add migration note for az aware hashring

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Alexander Rickardsson <[email protected]>
Signed-off-by: Michael Hoffmann <[email protected]>
Co-authored-by: Michael Hoffmann <[email protected]>

* Reformat asciiflow chart

Signed-off-by: Douglas Camata <[email protected]>

* Proposal: query path tenancy  (#6320)

* Add 1st version of query path tenancy proposal

Signed-off-by: Douglas Camata <[email protected]>

* Update proposal after initial feedback

Signed-off-by: Douglas Camata <[email protected]>

* Add cool picture

Signed-off-by: Douglas Camata <[email protected]>

* Include example in cross tenant query complications

Signed-off-by: Douglas Camata <[email protected]>

* Improve reasoning for why not using the QFE

Signed-off-by: Douglas Camata <[email protected]>

* Improve writing in "How" section

Signed-off-by: Douglas Camata <[email protected]>

* Fix owner profile link

Signed-off-by: Douglas Camata <[email protected]>

* Apply suggestions from code review

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Address few more PR review comments

Signed-off-by: Douglas Camata <[email protected]>

* Address feedback on flag name text

Signed-off-by: Douglas Camata <[email protected]>

* Update diagram

Signed-off-by: Douglas Camata <[email protected]>

* Improve non-goals text

Signed-off-by: Douglas Camata <[email protected]>

* Update diagram

Signed-off-by: Douglas Camata <[email protected]>

* Update docs/proposals-accepted/202304-query-path-tenancy.md

Co-authored-by: Filip Petkovski <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Clarify scenario for pitfalls of current solution

Signed-off-by: Douglas Camata <[email protected]>

* Clarify that Store doesn't care about tenant label

Signed-off-by: Douglas Camata <[email protected]>

* Add an action plan

Signed-off-by: Douglas Camata <[email protected]>

* Mention alternative idea of modifying Store API

Signed-off-by: Douglas Camata <[email protected]>

* Fix typo

Co-authored-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Address lots of feedback on the proposal

Signed-off-by: Douglas Camata <[email protected]>

* Format query path tenancy proposal doc

Signed-off-by: Douglas Camata <[email protected]>

* Add a "Tenancy Model" subsection to "Goals"

Signed-off-by: Douglas Camata <[email protected]>

* Mention header semanthics in comparison with gRPC message field

Signed-off-by: Douglas Camata <[email protected]>

* Improve action plan structure and writing

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>
Co-authored-by: Saswata Mukherjee <[email protected]>
Co-authored-by: Filip Petkovski <[email protected]>
Co-authored-by: Giedrius Statkevičius <[email protected]>

* Fix double-counting bug in http_request_duration metric (#6399)

* fix double-counting bug in http_request_duration metric

Signed-off-by: 4orty <[email protected]>

* Update Changelog

Signed-off-by: 4orty <[email protected]>

---------

Signed-off-by: 4orty <[email protected]>

* Replace group with resolution in compact metrics.

Compaction metrics have too high a cardinality, causing metric bloat on
large installations. The group information is better suited to logs.
* Replace with a `resolution` label to the compaction counters.

Fixes: https://github.com/thanos-io/thanos/issues/5841

Signed-off-by: SuperQ <[email protected]>

* Reuse static metrics server from e2e framework

Signed-off-by: Douglas Camata <[email protected]>

* Run go mod tidy

Signed-off-by: Douglas Camata <[email protected]>

* Updates busybox SHA (#6403)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Fix series stats merge (#6408)

* fix series stats merge

Signed-off-by: Ben Ye <[email protected]>

* update license header

Signed-off-by: Ben Ye <[email protected]>

* use reflect

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: allow unlimited head_series_limit tenants (#6406)

With this commit we now allow to configure tenants with unlimited active
series limit by setting the limit to `0`. Prior to this commit setting a
per tenant limit to `0` would cause the tenant to be unable to write any
metrics at all.

This fixes: https://github.com/thanos-io/thanos/issues/6393

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* expose downloaded data size in query hints (#6409)

Signed-off-by: Ben Ye <[email protected]>

* maintainers: add myself to triagers (#6414)

Signed-off-by: Michael Hoffmann <[email protected]>

* Add `@douglascamata` to triagers (#6418)

Signed-off-by: Douglas Camata <[email protected]>

* Add Blog (#6411)

* Add LFX blog

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add Headers to blog

Signed-off-by: Pradyumna Krishna <[email protected]>

* Lint blog

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* blog: Fix images for LFX post (#6422)

* blog: Fix images for LFX post

Signed-off-by: Saswata Mukherjee <[email protected]>

* fix lint

Signed-off-by: Saswata Mukherjee <[email protected]>

---------

Signed-off-by: Saswata Mukherjee <[email protected]>

* Index Cache: Change cache key for postings (#6405)

* extend postings cache key with codec

Signed-off-by: Ben Ye <[email protected]>

* add changelog

Signed-off-by: Ben Ye <[email protected]>

* update code back

Signed-off-by: Ben Ye <[email protected]>

* add colon

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* fix another test

Signed-off-by: Ben Ye <[email protected]>

* add compression scheme const to remote index cache

Signed-off-by: Ben Ye <[email protected]>

* address required comments

Signed-off-by: Ben Ye <[email protected]>

* fix compression scheme name

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: upgrading logs for failed uploads to error (#6427)

* FIX: upgrading log for failed upload to error

Signed-off-by: Victor Fernandes <[email protected]>

* docs: added changelog entry

Signed-off-by: Victor Fernandes <[email protected]>

---------

Signed-off-by: Victor Fernandes <[email protected]>

* fix postings test

Signed-off-by: Ben Ye <[email protected]>

* Add aiven as adopter... more soon!

Signed-off-by: Jonah Kowall <[email protected]>

* First draft of the Aiven adoption story

Signed-off-by: Jonah Kowall <[email protected]>

* Add aiven as adopter... more soon! (#6430)

Signed-off-by: Jonah Kowall <[email protected]>

* Report gRPC connnection errors to the caller (#6428)

By default `grpc.DialContext()` is non-blocking so any connection issue
will not be surfaced to the user. This change makes it blocking and
configures the gRPC dialer to report the underlying error if any
happens.

Signed-off-by: Simon Pasquier <[email protected]>

* chore: remove duplicated `gopkg.in/fsnotify.v1` dep (#6432)

* chore: remove duplicated `gopkg.in/fsnotify.v1` dep

`github.com/fsnotify/fsnotify` and `gopkg.in/fsnotify.v1` are the same
dependency. We can keep `github.com/fsnotify/fsnotify` and remove
`gopkg.in/fsnotify.v1`.

Signed-off-by: Eng Zer Jun <[email protected]>

* docs: add changelog

Signed-off-by: Eng Zer Jun <[email protected]>

---------

Signed-off-by: Eng Zer Jun <[email protected]>

* Expose estimated chunk and series size as configurable options (#6426)

* expose estimated chunk and series size as configurable options

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: make tsdb stats limit configurable (#6437)

* Receive: make tsdb stats limit configurable

Signed-off-by: Michael Hoffmann <[email protected]>

* Receive: make tsdb stats limit configurable

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Michael Hoffmann <[email protected]>

* *: wire new Engine/Explain fields in query-frontend (#6433)

- Pass Engine/Explain fields in query-frontend codecs
- Add Engine field to QFE cache key
- Add e2e tests for all cases

Signed-off-by: Giedrius Statkevičius <[email protected]>

* index cache: Cache expanded postings (#6420)

* cache expanded postings in index cache

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* fix

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* rebase main and added compression name to key

Signed-off-by: Ben Ye <[email protected]>

* update key

Signed-off-by: Ben Ye <[email protected]>

* add e2e test for memcached

Signed-off-by: Ben Ye <[email protected]>

* fix cache config

Signed-off-by: Ben Ye <[email protected]>

* address review comments

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* add approximate series size to index stats (#6425)

Signed-off-by: Ben Ye <[email protected]>

* index stats: fix chunk size calculation (#6424)

Signed-off-by: Ben Ye <[email protected]>

* Remove some unused Cortex vendored code and metrics (#6440)

* Avoid direct cortex vendor dependency in promclient (#6443)

* use own explanation struct

Signed-off-by: Ben Ye <[email protected]>

* omit empty

Signed-off-by: Ben Ye <[email protected]>

* fix e2e test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* query.md: Added grpc_{client,server}_handled_total to metrics list. (#6351)

Fixes: #6280

Signed-off-by: Jonathan Davies <[email protected]>

* Updates busybox SHA (#6448)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* store: read postings directly into delta encoded format (#6442)

Instead of allocating bytes for raw postings, let's read them directly
into diff varint format to save memory.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* compact: Add Index Stats to block metadata (#6441)

* compactor set index stats on block

Signed-off-by: Ben Ye <[email protected]>

* comment

Signed-off-by: Ben Ye <[email protected]>

* change field

Signed-off-by: Ben Ye <[email protected]>

* update downsample

Signed-off-by: Ben Ye <[email protected]>

* add index stats into compaction

Signed-off-by: Ben Ye <[email protected]>

* fix tests

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* estimate block chunk and series size from metadata (#6449)

Signed-off-by: Ben Ye <[email protected]>

* Adding graphic for blog showing architecture

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing mermaid graph

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing mermaid graph again

Signed-off-by: Jonah Kowall <[email protected]>

* Remove image and fix mermaid for other flowchart

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing prod flowchart

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing prod flowchart title

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing md table

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing md table again

Signed-off-by: Jonah Kowall <[email protected]>

* Adding clarification on cost breakdowns

Signed-off-by: Jonah Kowall <[email protected]>

* Adding clarification on cost breakdowns

Signed-off-by: Jonah Kowall <[email protected]>

* Store: fix crash on empty regex matcher

Signed-off-by: Michael Hoffmann <[email protected]>

* Some corrections on text and links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing diagams

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing currencies

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing diagams

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing images

Signed-off-by: Jonah Kowall <[email protected]>

* Website: Fix blog images width (#6450)

* Set blog post images width to 100%

Blog Post images width isn't set and hence the images doesn't get
fit to the page. Setting width to 100% make sure images fit to
the web page and screen size.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Remove width constraint from blog images

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* Cache calculated mint and maxt for each remote engine (#6458)

The distributed optimizer in the Thanos engine calls MinT() and LabelSets multiple times
on each remote engine. These calculations can get expensive when an engine
covers a large amount of TSDBs.

This commit introduces caching of the calculated values for a remote
engine's mint, maxt and label sets.

Signed-off-by: Filip Petkovski <[email protected]>

* cache empty expanded postings (#6464)

Signed-off-by: Ben Ye <[email protected]>

* mixin/receive: add limits alerting (#6466)

* add some thanos receive limits alerts

Signed-off-by: Thibault Mange <[email protected]>

* update changelog

Signed-off-by: Thibault Mange <[email protected]>

* fix and generate examples

Signed-off-by: Thibault Mange <[email protected]>

* quick fix

Signed-off-by: Thibault Mange <[email protected]>

* quick fix

Signed-off-by: Thibault Mange <[email protected]>

* fix test

Signed-off-by: Thibault Mange <[email protected]>

* fix invalid changelog

Signed-off-by: Thibault Mange <[email protected]>

---------

Signed-off-by: Thibault Mange <[email protected]>

* Update docs/blog/2023-06-08-thanos-at-aiven.md

Co-authored-by: Bartlomiej Plotka <[email protected]>
Signed-off-by: Jonah Kowall <[email protected]>

* Add retention for M3

Signed-off-by: Jonah Kowall <[email protected]>

* Add image versus mermaid diagram. Couldn't comment it out unfortunately

Signed-off-by: Jonah Kowall <[email protected]>

* Adding text around link to fix linter

Signed-off-by: Jonah Kowall <[email protected]>

* make docs

Signed-off-by: Jonah Kowall <[email protected]>

* add alert for tenant reaching head series limit (#6467)

Signed-off-by: Thibault Mange <[email protected]>

* go.mod: bump rest of otel libs (#6447)

* go.mod: bump rest of otel libs

Bump these two OTEL libs to be like the rest of the OTEL libs. We had a
strange issue where `service.name` was not set even though it was in
environment variables. Bumping these libs fixes the problem.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* otlp: only set service.name if provided

Signed-off-by: Giedrius Statkevičius <[email protected]>

* e2e: add test case

Signed-off-by: Giedrius Statkevičius <[email protected]>

---------

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: disable pooling for postings benchmarks (#6473)

Pooling hides the real allocations in postings benchmarks because the
allocation only happens once really. In reality this is different when
multiple readers are created at once. Disable pooling in benchmarks to
understand what is happening.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Fixing date and author for Aiven blog (#6476)

* Fixing authors

Signed-off-by: Jonah Kowall <[email protected]>

* make docs and fixing date

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing authors

Signed-off-by: Jonah Kowall <[email protected]>

---------

Signed-off-by: Jonah Kowall <[email protected]>

* Check context when expanding postings 2nd attempt (#6471)

* check context when expanding postings

Signed-off-by: Ben Ye <[email protected]>

* import

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* [FEAT] Add thanos ruler blog post (#6477)

Signed-off-by: Hélia Barroso <[email protected]>

* blog: Small fixes to Aiven article (#6481)

* Correct some links and typos in 2023-06-08-thanos-at-aiven.md

The linkified URLs in the article were including the closing bracket, breaking the links. Make them proper Markdown links.
Also fixed a few other typos I spotted.

Signed-off-by: Hugh Cole-Baker <[email protected]>

* Update 2023-06-08-thanos-at-aiven.md

Clarify a couple of things in the final paragraph.

Signed-off-by: Hugh Cole-Baker <[email protected]>

---------

Signed-off-by: Hugh Cole-Baker <[email protected]>

* Rename series and postings fetch duration metrics (#6479)

* fix wrong metric names for series and postings fetch duration

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* note breaking change

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Update to prometheus/common v0.44.0 (#6483)

Signed-off-by: Dan Bason <[email protected]>

* go.mod: update rueidis client (#6485)

The latest improvements have great perf improvements. Let's update it.
Thank you to [rueian](https://github.com/rueian) and all of the
contributors to that awesome Redis client!

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Introduce tenancy package (#6482)

This commit introduces a tenancy package in preparation for introduction
of tenancy in the query path. Tenancy related code which can be common
between components are moved out of the receive component into the
tenancy package.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Ignore nginx.com links in mdox (#6489)

Signed-off-by: Saswata Mukherjee <[email protected]>

* blog: Update Aiven blog post (#6487)

Wording changes and better formatting for the tables.

Signed-off-by: Simon Brüggen <[email protected]>

* store: optimized snappy streamed reading (#6475)

Optimize snappy streamed reading by traversing through the byte slice in
advance to determine how big of a buffer we will need. I have opted to
rewrite snappy streamed format decoding because it is a straightforward
format. Complex parts were deferred to klauspost/compress.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Remove Exists call in meta fetcher (#6474)

* Remove Exists call in meta fetcher

The meta fetcher lists the bucket by iterating through
top level paths from the entire keyspace, and then for each key
calls Exists on the meta.json file. This leads to an N+1 amplification
against object storage, manifesting as a very high increase in costs
and occasional throttling by cloud providers.

This commit changes the iteration logic to recursively list all files instead,
which can be done with far fewer API calls to object storage. Meta files
are then identified from the keys returned by the list operation instead
of making one API request from each file.

Signed-off-by: Filip Petkovski <[email protected]>

* Revert e2e test change

Signed-off-by: Filip Petkovski <[email protected]>

---------

Signed-off-by: Filip Petkovski <[email protected]>

* e2e/store: use now instead of time.Now() each time (#6493)

Consistently use the same timestamp instead of the current time each
time during a test.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* [FIX] Documentation issue (#6494)

Signed-off-by: Hélia Barroso <[email protected]>

* Updates busybox SHA (#6497)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* chore: pkg imported more than once (#6499)

* chore: pkg imported more than once

Signed-off-by: guoguangwu <[email protected]>

* fix: remove pkg alias

Signed-off-by: guoguangwu <[email protected]>

---------

Signed-off-by: guoguangwu <[email protected]>

* *: Remove unnecessary configuration reload from `ContentPathReloader` and improve its tests (#6496)

* Fix and improve PathContentReloader tests

Signed-off-by: Douglas Camata <[email protected]>

* Run tests in parallel

Signed-off-by: Douglas Camata <[email protected]>

* Add changelog entry

Signed-off-by: Douglas Camata <[email protected]>

* Fix table tests

Signed-off-by: Douglas Camata <[email protected]>

* Fix typo

Co-authored-by: Filip Petkovski <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>
Co-authored-by: Filip Petkovski <[email protected]>

* add context check when decoding cached postings (#6506)

Signed-off-by: Ben Ye <[email protected]>

* *: Change the engine behind `ContentPathReloader` to be completely independent of any filesystem concept. (#6503)

* Add fallback config reload for symlinks

Signed-off-by: Douglas Camata <[email protected]>

* Improve pooling config reload

Signed-off-by: Douglas Camata <[email protected]>

* Make tests more reliable

Signed-off-by: Douglas Camata <[email protected]>

* Improve tests again

Assert on runutil.Repeat output

Signed-off-by: Douglas Camata <[email protected]>

* Pass the debounce/reload time to each test

Signed-off-by: Douglas Camata <[email protected]>

* Add comments and ensure interfaces are implemented

Signed-off-by: Douglas Camata <[email protected]>

* Make the limit configuration reload time customizable

Signed-off-by: Douglas Camata <[email protected]>

* goimports file

Signed-off-by: Douglas Camata <[email protected]>

* Fix lint warning

Signed-off-by: Douglas Camata <[email protected]>

* Improve log for polling engine

Signed-off-by: Douglas Camata <[email protected]>

* Fix tests

Signed-off-by: Douglas Camata <[email protected]>

* Make linter happy

Signed-off-by: Douglas Camata <[email protected]>

* Extract symlink identification to a separate function

Signed-off-by: Douglas Camata <[email protected]>

* Update changelog

Signed-off-by: Douglas Camata <[email protected]>

* Fix links to go-grpc-middleware after v2 merge into main

Signed-off-by: Douglas Camata <[email protected]>

* Add period to make linter happy.

Signed-off-by: Douglas Camata <[email protected]>

* Update changelog entry

Signed-off-by: Douglas Camata <[email protected]>

* Replace the fsnotify based engine from `PathContentReloader` with the polling one

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Remove check for empty filePath

Signed-off-by: Douglas Camata <[email protected]>

* Unexpose pollingEngine.Start

Signed-off-by: Douglas Camata <[email protected]>

* Fix pollingEngine doc-comment

Signed-off-by: Douglas Camata <[email protected]>

* Log file path when config is reloaded

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>

* receive: add float histogram support (#6323)

* Added receive float histogram support

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed imports

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Added comments for fns copied from Prometheus

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Improved comment

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Removed unnecessary if

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Fixed native histogram proto conversion in remote engine

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Removed unused histogram conversion from remote engine

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Fix and renaming in native_histograms_test.go

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Trigger Build

Signed-off-by: Sebastian Rabenhorst <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* go.mod: bump e2e framework version (#6516)

Bump e2e framework version and add a note about E2E_DOCKER_CPUS.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Add changelog for #6474 (#6518)

Signed-off-by: Filip Petkovski <[email protected]>

* cortex/redisclient: use rueidis client (#6520)

* cortex/redisclient: use rueidis client

Use the same rueidis client in query-frontend. Solves
https://github.com/thanos-io/thanos/issues/6094.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* cortex/cache: gofumpt + fix errors.Errorf

Signed-off-by: Giedrius Statkevičius <[email protected]>

* cacheutil/docs: clean up more old stuff

Signed-off-by: Giedrius Statkevičius <[email protected]>

---------

Signed-off-by: Giedrius Statkevičius <[email protected]>

* index header: Remove memWriter from fileWriter (#6509)

* index header: remove memWriter from fileWriter

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* refactor

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

* update comment

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Wrap object store Prometheus registry (#6152)

* Wrap object store Prometheus registery

In preparation for the work being done at https://github.com/thanos-io/objstore/pull/26.

Signed-off-by: Douglas Camata <[email protected]>

* Update objstore to the latest version

This version removes the `thanos_` prefix from metrics, which is the
reason for wrapping the objstore's metrics registry in the first place.

Signed-off-by: Douglas Camata <[email protected]>

* Fix modules

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Wrap metrics registerer for objstore bucket

Signed-off-by: Douglas Camata <[email protected]>

* Remove prefix from Thanos Store metrics

Signed-off-by: Douglas Camata <[email protected]>

* Fix goimports

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Put back upgraded objstore dep

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Move to more recent ref of thanos/objstore

Signed-off-by: Douglas Camata <[email protected]>

* Ignore OBS in objstore tests

Signed-off-by: Douglas Camata <[email protected]>

* Fix linting error on main test after objstore upgrade

Signed-off-by: Douglas Camata <[email protected]>

* Skip OCS objstore test in circle ci

Signed-off-by: Douglas Camata <[email protected]>

* Fix echo in makefile

Signed-off-by: Douglas Camata <[email protected]>

* Fix typo

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>

* e2e/store: try to fix Series() limit test again (#6522)

I finally managed to reproduce this failure locally with
https://github.com/efficientgo/e2e/commit/c316eb95ae5b0fa65b0be110f8cfc3c48e8810bb.
The added t.Logf() showed that is the problem is that with a lower bytes
limit, it might hit the series or chunks part first. I have bumped the
bytes limit. I calculated the new bytes limit by checking how much bytes
are allocated before sending the last chunk.

I have also noticed that one block is created without a delay. Update it
so that it would be like the others.

Include objstore@main update with
https://github.com/thanos-io/objstore/pull/62/files so that Iter() would
always return an error on a timeout.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* pkg/reloader: use watchInterval timeout for initial apply (#6519)

* pkg/reloader: use watchInterval timeout for initial apply

Signed-off-by: Craig Peterson <[email protected]>

* changelog

Signed-off-by: Craig Peterson <[email protected]>

* use distinct context for initial sync

Signed-off-by: Craig Peterson <[email protected]>

---------

Signed-off-by: Craig Peterson <[email protected]>

* Standardize index cache metrics (#6523)

* Add histogram metrics for index cache item size (#6528)

* add histogram metrics for index cache item size

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Upgrade objstore (#6507)

* Upgrade objstore

Signed-off-by: Kemal Akkoyun <[email protected]>

* Update with the latest APIs

Signed-off-by: Kemal Akkoyun <[email protected]>

---------

Signed-off-by: Kemal Akkoyun <[email protected]>
Co-authored-by: Matej Gera <[email protected]>

* Make compact lifecycle more flexible to be overridden for sharded compaction (#5964)

* Updates busybox SHA (#6534)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* BucketedBytes to buffer byte slices when decoding postings from cache (#6531)

* BucketedBytes to buffer byte slices when deconding postings from cache

Signed-off-by: Alan Protasio <[email protected]>

* Fixing Lint

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Shipper: change upload compacted type from bool to a function (#6526)

* change shipper upload compacted type from bool to a function

Signed-off-by: Ben Ye <[email protected]>

* add default to false

Signed-off-by: Ben Ye <[email protected]>

* reset uploadedCompacted to 0

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Query: Forward tenant information via StoreAPI (#6530)

* Querier: Forward tenant information downstream

With this commit we attach tenant information to each query request and
forward it via the StoreAPI to any downstream Store Gateways and
Queriers.

We add the following command lines options which mimics the tenant
functionality in Receive. The options are currently hidden, as they
provide no real functionality yet. This will come in future steps.

--query.tenant-header
--query.default-tenant
--query.tenant-certificate

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Receive: Use CertificateField from Tenancy pkg

These consts are now defined in the Tenancy package, so we should use
those instead.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

---------

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Deduplicate matchers in posting group (#6532)

* deduplicate matchers in posting group

Signed-off-by: Ben Ye <[email protected]>

* don't use map for deduplication

Signed-off-by: Ben Ye <[email protected]>

* lint

Signed-off-by: Ben Ye <[email protected]>

* address comments

Signed-off-by: Ben Ye <[email protected]>

* fi…
subbarao-meduri added a commit to stolostron/thanos that referenced this issue Sep 21, 2023
* fix 0.31 changelog (#6278)

Signed-off-by: junot <[email protected]>

* Query: Switch Multiple Engines (#6234)

* Query: Switch engines using `engine` param

Thanos query has two engine, prometheus (default) and thanos.
A single engine runs through thanos query command at a time, and
have to re run the command to switch between.

This commit adds a functionality to run multiple engines at once
and switch between them using `engine` query param inq query api.

To avoid duplicate matrics registration, the thanos engine is
provided with a different registerer having prefix `tpe_` (not
been finalized yet).

promql-engine command line flag has been removed that specifies
the query engine to run.

Currently this functionality not implemented on GRPCAPI.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add multiple engine support to GRPCAPI

Fix build fail for thanos, adds support for multiple engine in
GRPCAPI.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Create QueryEngineFactory to create engines

QueryEngineFactory makes a collection for all promql engines used
by thanos and returns it. Any engine can be created and returned
using `GetXEngine` method.

It is currently limited to 2 engines prometheus and thanos engines
that get created on the first call.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Use QueryEngineFactory in query API

thanos query commands pass `QueryEngineFactory` to query apis
that will use engine based on query params. It will provide more
flexibility to create multiple engines in thanos.

Adds `defaultEngine` CLI flag, A default engine to use if not
specified with query params.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update Query API tests

Fixes breaking tests

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor changes and Docs fixes

* Move defaultEngine argument to reduce diff.
* Generated Docs.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add Engine Selector/ Dropdown to Query UI

Engine Selector is a dropdown that sets an engine to be used to
run the query. Currently two engines `thanos` and `prometheus`.

This dropdown sends a query param `engine` to query api, which
runs the api using the engine provided. Provided to run query
using multiple query engines from Query UI.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Move Engine Selector to Panel

Removes Dropdown component, and renders Engine Selector directly.
Receives defaultEngine from `flags` API.
Updates parseOptions to parse engine query param and updates test
for Panel and utils.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Upgrade promql-engine dependency

Updates promql-engine that brings functionality to provide
fallback engine using enigne Opts.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add MinT to remote client

MinT method was missing from Client due to updated promql-engine.
This commits adds mint to the remote client.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Use prometheus fallback engine in thanos engine

Thanos engine creates a fallback prometheus engine that conflicts
with another prometheus engine created by thanos, while
registering metrics. To fix this, provided created thanos engine
as fallback engine to thanos engine in engine Opts.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Use enum for EngineType in GRPC

GRPC is used for communication between thanos components and
defaultEngine was a string before. Enum makes more sense, and
hence the request.Enigne type has been changed to
querypb.EngineType.
Default case is handled with another default value provided in
the enum.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update query UI bindata.go

Compile react app using `make assets`.

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* docs: mismatch in changelog

Signed-off-by: Etienne Martel <[email protected]>

* Updates busybox SHA (#6283)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Upgrade prometheus to 7309ac272195cb856b879306d6a27af7641d3346 (#6287)

* Upgrade prometheus to 7309ac272195cb856b879306d6a27af7641d3346

Signed-off-by: Alex Le <[email protected]>

* Reverted test code

Signed-off-by: Alex Le <[email protected]>

* Updated comment

Signed-off-by: Alex Le <[email protected]>

* docs: mismatch in changelog

Signed-off-by: Etienne Martel <[email protected]>
Signed-off-by: Alex Le <[email protected]>

* Updates busybox SHA (#6283)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>
Signed-off-by: Alex Le <[email protected]>

* trigger workflow

Signed-off-by: Alex Le <[email protected]>

* trigger workflow

Signed-off-by: Alex Le <[email protected]>

---------

Signed-off-by: Alex Le <[email protected]>
Signed-off-by: Etienne Martel <[email protected]>
Signed-off-by: GitHub <[email protected]>
Co-authored-by: Etienne Martel <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: fpetkovski <[email protected]>

* Add CarTrade Tech as new adopter

Signed-off-by: naveadkazi <[email protected]>

* sort ProxyResponseHeap comparing only diff labels

Signed-off-by: Walther Lee <[email protected]>

* proxy heap: remove store labels before comparing response series

Signed-off-by: Walther Lee <[email protected]>

* tests: Remove custom Between test matcher (#6310)

* Remove custom Between test matcher

The upstream PR to efficientgo/e2e has been merged, so we can use  it from there.

Signed-off-by: Douglas Camata <[email protected]>

* Run go mod tidy

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>

* Remove testingRespSet and update comparison func

Signed-off-by: Walther Lee <[email protected]>

* Fix tests

Signed-off-by: Walther Lee <[email protected]>

* query frontend, query UI: Native histogram support (#6071)

* Implemented native histogram support for qfe and query UI

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed marshalling for histograms in qfe

Started working on native histogram query ui

Copied histogram implementation for graph

Added query range support for native histograms in qfe

Use prom model (un-)marshal for native histograms in qfe

Use prom model (un-)marshal for native histograms in qfe

Fixed sample and sample stream marshal fn

Extended qfe native histogram e2e tests

Added copyright to qfe queryrange compat

Added query range test fo histograms and try to fix ui tests

Fixed DataTable test

Review feedback

Fixed native histogram e2e test

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Add histogram support for ApplyCounterResetsSeriesIterator

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Made assets

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Add chnagelog

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed changelog

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed qfe

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed PrometheusResponse minTime for histograms in qfe

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Updated prometheus common to v0.40.0 and queryrange.Sample fixes

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Updated Readme

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Addressed PR comments

Signed-off-by: Sebastian Rabenhorst <[email protected]>

trigger tests

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Made assets

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Made assets

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* fixed tsdbutil references

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* fixed imports

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Enabled pushdown for query native hist test and removed ToDo

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Refactored native histogram query UI

Signed-off-by: Sebastian Rabenhorst <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* store: add streamed snappy encoding for postings list (#6303)

* store: add streamed snappy encoding for postings list

We've noticed that decoding Snappy compressed postings list
takes a lot of RAM:

```
(pprof) top
Showing nodes accounting for 1427.30GB, 67.55% of 2112.82GB total
Dropped 1069 nodes (cum <= 10.56GB)
Showing top 10 nodes out of 82
      flat  flat%   sum%        cum   cum%
         0     0%     0%  1905.67GB 90.20%  golang.org/x/sync/errgroup.(*Group).Go.func1
    2.08GB 0.098% 0.098%  1456.94GB 68.96%  github.com/thanos-io/thanos/pkg/store.(*blockSeriesClient).ExpandPostings
    1.64GB 0.078%  0.18%  1454.87GB 68.86%  github.com/thanos-io/thanos/pkg/store.(*bucketIndexReader).ExpandedPostings
    2.31GB  0.11%  0.29%  1258.15GB 59.55%  github.com/thanos-io/thanos/pkg/store.(*bucketIndexReader).fetchPostings
    1.48GB  0.07%  0.36%  1219.67GB 57.73%  github.com/thanos-io/thanos/pkg/store.diffVarintSnappyDecode
 1215.21GB 57.52% 57.87%  1215.21GB 57.52%  github.com/klauspost/compress/s2.Decode
```

This is because we are creating a new []byte slice for the decoded data
each time. To avoid this RAM usage problem, let's stream the decoding
from a given buffer. Since Snappy block format doesn't support streamed
decoding, let's switch to Snappy stream format which is made for exactly
that.

Notice that our current `index.Postings` list does not
support going back through Seek() even if theoretically one could want
something like that. Fortunately, to search for posting intersection, we
need to only go forward.

Benchmark data:

```
name                                                          time/op
PostingsEncodingDecoding/10000/raw/encode-16                  71.6µs ± 3%
PostingsEncodingDecoding/10000/raw/decode-16                  76.3ns ± 4%
PostingsEncodingDecoding/10000#01/snappy/encode-16            73.3µs ± 1%
PostingsEncodingDecoding/10000#01/snappy/decode-16            1.63µs ± 6%
PostingsEncodingDecoding/10000#02/snappyStreamed/encode-16     111µs ± 2%
PostingsEncodingDecoding/10000#02/snappyStreamed/decode-16    14.5µs ± 7%
PostingsEncodingDecoding/100000/snappyStreamed/encode-16      1.09ms ± 2%
PostingsEncodingDecoding/100000/snappyStreamed/decode-16      14.4µs ± 4%
PostingsEncodingDecoding/100000#01/raw/encode-16               710µs ± 1%
PostingsEncodingDecoding/100000#01/raw/decode-16              79.3ns ±13%
PostingsEncodingDecoding/100000#02/snappy/encode-16            719µs ± 1%
PostingsEncodingDecoding/100000#02/snappy/decode-16           13.5µs ± 4%
PostingsEncodingDecoding/1000000/raw/encode-16                7.14ms ± 1%
PostingsEncodingDecoding/1000000/raw/decode-16                81.7ns ± 9%
PostingsEncodingDecoding/1000000#01/snappy/encode-16          7.52ms ± 3%
PostingsEncodingDecoding/1000000#01/snappy/decode-16           139µs ± 4%
PostingsEncodingDecoding/1000000#02/snappyStreamed/encode-16  11.4ms ± 4%
PostingsEncodingDecoding/1000000#02/snappyStreamed/decode-16  15.5µs ± 4%

name                                                          alloc/op
PostingsEncodingDecoding/10000/raw/encode-16                  13.6kB ± 0%
PostingsEncodingDecoding/10000/raw/decode-16                   96.0B ± 0%
PostingsEncodingDecoding/10000#01/snappy/encode-16            25.9kB ± 0%
PostingsEncodingDecoding/10000#01/snappy/decode-16            11.0kB ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/encode-16    16.6kB ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/decode-16     148kB ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/encode-16       148kB ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/decode-16       148kB ± 0%
PostingsEncodingDecoding/100000#01/raw/encode-16               131kB ± 0%
PostingsEncodingDecoding/100000#01/raw/decode-16               96.0B ± 0%
PostingsEncodingDecoding/100000#02/snappy/encode-16            254kB ± 0%
PostingsEncodingDecoding/100000#02/snappy/decode-16            107kB ± 0%
PostingsEncodingDecoding/1000000/raw/encode-16                1.25MB ± 0%
PostingsEncodingDecoding/1000000/raw/decode-16                 96.0B ± 0%
PostingsEncodingDecoding/1000000#01/snappy/encode-16          2.48MB ± 0%
PostingsEncodingDecoding/1000000#01/snappy/decode-16          1.05MB ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/encode-16  1.47MB ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/decode-16   148kB ± 0%

name                                                          allocs/op
PostingsEncodingDecoding/10000/raw/encode-16                    2.00 ± 0%
PostingsEncodingDecoding/10000/raw/decode-16                    2.00 ± 0%
PostingsEncodingDecoding/10000#01/snappy/encode-16              3.00 ± 0%
PostingsEncodingDecoding/10000#01/snappy/decode-16              4.00 ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/encode-16      4.00 ± 0%
PostingsEncodingDecoding/10000#02/snappyStreamed/decode-16      5.00 ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/encode-16        4.00 ± 0%
PostingsEncodingDecoding/100000/snappyStreamed/decode-16        5.00 ± 0%
PostingsEncodingDecoding/100000#01/raw/encode-16                2.00 ± 0%
PostingsEncodingDecoding/100000#01/raw/decode-16                2.00 ± 0%
PostingsEncodingDecoding/100000#02/snappy/encode-16             3.00 ± 0%
PostingsEncodingDecoding/100000#02/snappy/decode-16             4.00 ± 0%
PostingsEncodingDecoding/1000000/raw/encode-16                  2.00 ± 0%
PostingsEncodingDecoding/1000000/raw/decode-16                  2.00 ± 0%
PostingsEncodingDecoding/1000000#01/snappy/encode-16            3.00 ± 0%
PostingsEncodingDecoding/1000000#01/snappy/decode-16            4.00 ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/encode-16    4.00 ± 0%
PostingsEncodingDecoding/1000000#02/snappyStreamed/decode-16    5.00 ± 0%
```

Compression ratios are still the same like previously:

```
$ /bin/go test -v -timeout 10m -run ^TestDiffVarintCodec$ github.com/thanos-io/thanos/pkg/store
[snip]
=== RUN   TestDiffVarintCodec/snappy/i!~"2.*"
    postings_codec_test.go:73: postings entries: 944450
    postings_codec_test.go:74: original size (4*entries): 3777800 bytes
    postings_codec_test.go:80: encoded size 44498 bytes
    postings_codec_test.go:81: ratio: 0.012
=== RUN   TestDiffVarintCodec/snappyStreamed/i!~"2.*"
    postings_codec_test.go:73: postings entries: 944450
    postings_codec_test.go:74: original size (4*entries): 3777800 bytes
    postings_codec_test.go:80: encoded size 44670 bytes
    postings_codec_test.go:81: ratio: 0.012
```

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: clean up postings code

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: fix estimation

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: use buffer.Bytes()

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store/postings_codec: reuse extgrpc compressors/decompressors

Signed-off-by: Giedrius Statkevičius <[email protected]>

* CHANGELOG: add item

Signed-off-by: Giedrius Statkevičius <[email protected]>

* CHANGELOG: clean up whitespace

Signed-off-by: Giedrius Statkevičius <[email protected]>

---------

Signed-off-by: Giedrius Statkevičius <[email protected]>

* compact: atomically replace no compact marked map (#6319)

With lots of blocks it could take some time to fill this no compact
marked map hence replace it atomically. I believe this leads to problems
in the compaction planner where it picks up no compact marked blocks
because meta syncer does synchronizations concurrently.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Reuse buffers for label comparison

Signed-off-by: Filip Petkovski <[email protected]>

* Use len instead of cap

Signed-off-by: Filip Petkovski <[email protected]>

* Use len instead of cap

Signed-off-by: Filip Petkovski <[email protected]>

* Fixed Jaeger exporter specification link (#6324)

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* receive: Make max backoff configurable (#6163)

Signed-off-by: Philip Gough <[email protected]>

* Replace summary in extprom metrics with histogram (#6327)

* Replaced summary in extprom metrics with histogram

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Added changelog

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Removed unused parameters from NewInstrumentationMiddleware

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Reverted NewInstrumentationMiddleware

Signed-off-by: Sebastian Rabenhorst <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Expose info for each TSDB

This commit exposes the label set alongside the min and max time
for each TSDB covered by a Store.

This information is used to scope the min time for a remote query
so that we do not produce partial aggregates in distriuted mode.

Signed-off-by: Filip Petkovski <[email protected]>

* Add test case for proxy store

Signed-off-by: Filip Petkovski <[email protected]>

* Pass engine factory by reference

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Cleanup

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Use NewQueryEngineFactory in tests

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Avoid expensive log.Valuer evaluation for disallowed levels (#6322)

Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>

* Fix inconsistent error for series limits in Store API (#6330)

* store: fix inconsistent error for series limits

Signed-off-by: Thibault Mange <[email protected]>

* update changelog

Signed-off-by: Thibault Mange <[email protected]>

* Update pkg/store/bucket.go

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Thibault Mange <[email protected]>

* Update pkg/store/bucket.go

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Thibault Mange <[email protected]>

* rename labelValues serires liimiter test function

Signed-off-by: Thibault Mange <[email protected]>

---------

Signed-off-by: Thibault Mange <[email protected]>
Co-authored-by: Saswata Mukherjee <[email protected]>

* *: remove unmaintained gzip library (#6332)

Switch from nytimes gzip library to the klaustpost's gzip code. The old
gzip HTTP handler shows up a lot in allocs so that's how I ended up
doing this change.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Traces sampler env var (#6306)

* Issue#5947 OTEL_TRACES_SAMPLER env var

Signed-off-by: shayyxi <[email protected]>

* Test correction

Signed-off-by: shayyxi <[email protected]>

* doc failure correction. parse float argument correction.

Signed-off-by: shayyxi <[email protected]>

* added the changelog.

Signed-off-by: shayyxi <[email protected]>

* ran make docs to fix the build failure.

Signed-off-by: shayyxi <[email protected]>

* corrected the incorrect change in tools.md

Signed-off-by: shayyxi <[email protected]>

* fixed review comments.

Signed-off-by: shayyxi <[email protected]>

---------

Signed-off-by: shayyxi <[email protected]>
Signed-off-by: Shazi <[email protected]>
Co-authored-by: shayyxi <[email protected]>

* query: use storepb.SeriesServer (#6334)

Use storepb.SeriesServer instead of the concrete struct. This allows
implementing functionality on top of the proxy.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* cacheutil: upgrade `rueidis` to v1.0.2 to improve error handling while shrinking a redis cluster. https://github.com/redis/rueidis/issues/209 (#6342)

* use github.com/onsi/gomega/gleak to detect goroutine leak with timeout

Signed-off-by: Rueian <[email protected]>

* fix: spelling errors DoInSpanWtihErr to DoInSpanWithErr (#6345)

Signed-off-by: aimuz <[email protected]>

* Return grpc code resource exhausted for byte limit error (#6325)

* return grpc code resource exhausted for byte limit error

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* update partial response strategy

Signed-off-by: Ben Ye <[email protected]>

* fix limit

Signed-off-by: Ben Ye <[email protected]>

* try to fix tests

Signed-off-by: Ben Ye <[email protected]>

* fix test error message

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Bump promql-engine to fix https://github.com/thanos-community/promql-engine/issues/239 (#6349)

Signed-off-by: Alban HURTAUD <[email protected]>

* Optimize generating store match reason (#6355)

Removes reason generation when debug logging is not enabled.

Signed-off-by: Filip Petkovski <[email protected]>

* Updates busybox SHA (#6365)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Query: Add +Inf bucket to query duration metrics  (#6358)

* Query: Add +Inf bucket to query duration metrics

For the query duration metrics
(`thanos_store_api_query_duration_seconds`), we record query respond
latency, based on the size of the query (samples/series), and save to a
histogram.

However, when a query is made which exceeds the biggest sample/serie
size, we would prior to this commit, put the request into the largest
bucket.

With this commit, we instead create an `+Inf` bucket, and put requests
which are larger than the biggest defined bucket into that. This gives
more accurate results, and also allow one to see if the bucket sizes are
incorrectly sized.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Tests: Mutex around non-thread safe random source

When creating test blocks, we use a non-thread safe random source, in
multiple goroutines. Due to this, tests would sometime panic.

This commits puts a mutex around calls using the same source, in order
to avoid this.

This should hopefully improve reliability of e2e tests.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

---------

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Check context when expanding postings (#6363)

* check context when expanding postings

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* ui: only keep name in store_matches param (#6371)

We are doing store matching on the `name` field hence only keep that
field in the URL because otherwise the URL could get quite lengthy with
external labelsets inside of it.

Besides unit tests, I have also tested locally:
- Enable store filtering;
- Select store(-s);
- Copy/paste URL into the new tab and see that the same stores are
  loaded like expected;
- See that URL only has names in them.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* docs: replace --store with --endpoint

Replace deprecated `--store` with `--endpoint` in docs.

Signed-off-by: Paul Gier <[email protected]>

* Optimizing "grafana generated" regex matchers (#6376)

* Opmizing Group Regex

Signed-off-by: Alan Protasio <[email protected]>

* fixing native histogram tests

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Cache: various index cache client improvements (#6374)

* e2e(query): Reproduce dedup issue from #6257

Signed-off-by: Douglas Camata <[email protected]>

* Add dedup e2e test for Receive

With internal and external labels support.

Signed-off-by: Douglas Camata <[email protected]>

* Simplify generated blocks for query test

Signed-off-by: Douglas Camata <[email protected]>

* Improve query dedup test

Signed-off-by: Douglas Camata <[email protected]>

* Write a query test for dedup with sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Refactor query dedup test with sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Fix Receive query test

Now it properly ensures the double dedup works (on internal and external labels).

Signed-off-by: Douglas Camata <[email protected]>

* Fix receive drawing

Signed-off-by: Douglas Camata <[email protected]>

* Add one extra test caes for query dedup from store

Signed-off-by: Douglas Camata <[email protected]>

* Complement test for Receive query with dedup

Signed-off-by: Douglas Camata <[email protected]>

* Complement test for Sidecar query dedup

Signed-off-by: Douglas Camata <[email protected]>

* Query Explanation (#6346)

* Return Query Explaination in QueryAPI

A param `explain` is added to QueryAPI, if true then explanation
returned by the `Explain()` method of the query having structure
`ExplainOutputNode` is returned in response.
Query Explanation is added under new field in response that is
`thanosInfo`.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add explain checkbox in thanos UI

A explain checkbox is added to Thanos Query UI, that requests for
query explanation from thanos query api.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add ExpandableNode Component

ExpandableNode component renders Query Explanation in the thanos
UI. Requires a new package `react-accessible-treeview`.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Disable Explain checkbox on prometheus engine

Prometheus engine sends out error if toggle explain button. To
provide better experience, the explain checkbox get disbaled on
switching to prometheus engine and enable back on switching to
thanos engine.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add alert box with horizontal scrolling for Explanation

Signed-off-by: Pradyumna Krishna <[email protected]>

* Remove ExpandableNode and Add ListTree

Updates the design for query explanation box, removes
`ExpandableNode` and the dependency. Builts a new `ListTree` that
does the same using reactstrap and custom css.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor refactor in Query API response

`thanosInfo` is removed from Query reponse and used `explanation`
directly. `disableCheckbox` is also renamed to
`disableExplainCheckbox` in thanos UI.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update UI tests to passing

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor UI changes and test fix

UI improvements and Panel test fix other way around, resetting
the results on panel construction.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update promql-engine to use Explain method

Signed-off-by: Pradyumna Krishna <[email protected]>

* Build UI assets

Build UI assets, that runs new thanos UI with explain button.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Revert proxy url change from package.json

`proxy` was accidently changed and committed with package.json
when removed dependency. Hence, reverting it back.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor changes in UI

Fix requested changes in UI.
- Rename `state` and `setState` to `mapping` and `setMapping`.
- Rename `NodeTree` to `QueryTree`.
- Use unicode characters instead of `-` and `+`.
- Fix blue box on explain button.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update UI assets

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* Implementing Regex optimization on the `MatchNotRegexp` and `MatchNotEqual` matcher type (#6379)

* Implementing Regex optimization on the MatchNotRegexp matcher type

Signed-off-by: Alan Protasio <[email protected]>

* Opmizing MatchNotEqual

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Expected failure of block label query dedup tests

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Put back the correct makefile

Signed-off-by: Douglas Camata <[email protected]>

* add de-cix as adopter (#6386)

Signed-off-by: Raul Garcia Sanchez <[email protected]>

* Remove extra line that broke untouched test

Signed-off-by: Douglas Camata <[email protected]>

* Add back line break at end of makefile

Signed-off-by: Douglas Camata <[email protected]>

* Fix Receive single ingestor test

Signed-off-by: Douglas Camata <[email protected]>

* Reproduce dedup issue in Receive

Signed-off-by: Douglas Camata <[email protected]>

* Add even more test cases for dedup on store gw

Signed-off-by: Douglas Camata <[email protected]>

* Reproduce dedup bug in Sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Reuse nginx image name

Signed-off-by: Douglas Camata <[email protected]>

* Let all users read the metrics file from static metrics server

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* [chore] Updating Query Engine and Prometheus (#6392)

* Updating Query Engine

Signed-off-by: Alan Protasio <[email protected]>

* fix prometheus breaking change

Signed-off-by: Alan Protasio <[email protected]>

* Update prometheus with https://github.com/prometheus/prometheus/pull/12387

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Receive: Allow specifying tenant-specific external labels in RouterIngestor (#5777)

Signed-off-by: haanhvu <[email protected]>

* check context cancel when doing posting batches (#6396)

Signed-off-by: Ben Ye <[email protected]>

* Expose store gateway query stats in series response hints (#6352)

* expose query stats hints

Signed-off-by: Ben Ye <[email protected]>

* update

Signed-off-by: Ben Ye <[email protected]>

* add query stats hints in result

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* add merge method

Signed-off-by: Ben Ye <[email protected]>

* fix unit test

Signed-off-by: Ben Ye <[email protected]>

modify hints proto

Signed-off-by: Ben Ye <[email protected]>

fix unit test

Signed-off-by: Ben Ye <[email protected]>

update format

Signed-off-by: Ben Ye <[email protected]>

* update comments

Signed-off-by: Ben Ye <[email protected]>

* try again

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* receive: make az aware ketama hashring (#6369)

* receive: make az aware ketama hashring

Signed-off-by: Alexander Rickardsson <[email protected]>

* receive: pass endpoints in hashring config as object

Signed-off-by: Michael Hoffmann <[email protected]>

* receive: add some tests for consistent hashing in presence of AZs

Signed-off-by: Michael Hoffmann <[email protected]>

* receive,docs: add migration note for az aware hashring

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Alexander Rickardsson <[email protected]>
Signed-off-by: Michael Hoffmann <[email protected]>
Co-authored-by: Michael Hoffmann <[email protected]>

* Reformat asciiflow chart

Signed-off-by: Douglas Camata <[email protected]>

* Proposal: query path tenancy  (#6320)

* Add 1st version of query path tenancy proposal

Signed-off-by: Douglas Camata <[email protected]>

* Update proposal after initial feedback

Signed-off-by: Douglas Camata <[email protected]>

* Add cool picture

Signed-off-by: Douglas Camata <[email protected]>

* Include example in cross tenant query complications

Signed-off-by: Douglas Camata <[email protected]>

* Improve reasoning for why not using the QFE

Signed-off-by: Douglas Camata <[email protected]>

* Improve writing in "How" section

Signed-off-by: Douglas Camata <[email protected]>

* Fix owner profile link

Signed-off-by: Douglas Camata <[email protected]>

* Apply suggestions from code review

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Address few more PR review comments

Signed-off-by: Douglas Camata <[email protected]>

* Address feedback on flag name text

Signed-off-by: Douglas Camata <[email protected]>

* Update diagram

Signed-off-by: Douglas Camata <[email protected]>

* Improve non-goals text

Signed-off-by: Douglas Camata <[email protected]>

* Update diagram

Signed-off-by: Douglas Camata <[email protected]>

* Update docs/proposals-accepted/202304-query-path-tenancy.md

Co-authored-by: Filip Petkovski <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Clarify scenario for pitfalls of current solution

Signed-off-by: Douglas Camata <[email protected]>

* Clarify that Store doesn't care about tenant label

Signed-off-by: Douglas Camata <[email protected]>

* Add an action plan

Signed-off-by: Douglas Camata <[email protected]>

* Mention alternative idea of modifying Store API

Signed-off-by: Douglas Camata <[email protected]>

* Fix typo

Co-authored-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Address lots of feedback on the proposal

Signed-off-by: Douglas Camata <[email protected]>

* Format query path tenancy proposal doc

Signed-off-by: Douglas Camata <[email protected]>

* Add a "Tenancy Model" subsection to "Goals"

Signed-off-by: Douglas Camata <[email protected]>

* Mention header semanthics in comparison with gRPC message field

Signed-off-by: Douglas Camata <[email protected]>

* Improve action plan structure and writing

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>
Co-authored-by: Saswata Mukherjee <[email protected]>
Co-authored-by: Filip Petkovski <[email protected]>
Co-authored-by: Giedrius Statkevičius <[email protected]>

* Fix double-counting bug in http_request_duration metric (#6399)

* fix double-counting bug in http_request_duration metric

Signed-off-by: 4orty <[email protected]>

* Update Changelog

Signed-off-by: 4orty <[email protected]>

---------

Signed-off-by: 4orty <[email protected]>

* Replace group with resolution in compact metrics.

Compaction metrics have too high a cardinality, causing metric bloat on
large installations. The group information is better suited to logs.
* Replace with a `resolution` label to the compaction counters.

Fixes: https://github.com/thanos-io/thanos/issues/5841

Signed-off-by: SuperQ <[email protected]>

* Reuse static metrics server from e2e framework

Signed-off-by: Douglas Camata <[email protected]>

* Run go mod tidy

Signed-off-by: Douglas Camata <[email protected]>

* Updates busybox SHA (#6403)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Fix series stats merge (#6408)

* fix series stats merge

Signed-off-by: Ben Ye <[email protected]>

* update license header

Signed-off-by: Ben Ye <[email protected]>

* use reflect

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: allow unlimited head_series_limit tenants (#6406)

With this commit we now allow to configure tenants with unlimited active
series limit by setting the limit to `0`. Prior to this commit setting a
per tenant limit to `0` would cause the tenant to be unable to write any
metrics at all.

This fixes: https://github.com/thanos-io/thanos/issues/6393

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* expose downloaded data size in query hints (#6409)

Signed-off-by: Ben Ye <[email protected]>

* maintainers: add myself to triagers (#6414)

Signed-off-by: Michael Hoffmann <[email protected]>

* Add `@douglascamata` to triagers (#6418)

Signed-off-by: Douglas Camata <[email protected]>

* Add Blog (#6411)

* Add LFX blog

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add Headers to blog

Signed-off-by: Pradyumna Krishna <[email protected]>

* Lint blog

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* blog: Fix images for LFX post (#6422)

* blog: Fix images for LFX post

Signed-off-by: Saswata Mukherjee <[email protected]>

* fix lint

Signed-off-by: Saswata Mukherjee <[email protected]>

---------

Signed-off-by: Saswata Mukherjee <[email protected]>

* Index Cache: Change cache key for postings (#6405)

* extend postings cache key with codec

Signed-off-by: Ben Ye <[email protected]>

* add changelog

Signed-off-by: Ben Ye <[email protected]>

* update code back

Signed-off-by: Ben Ye <[email protected]>

* add colon

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* fix another test

Signed-off-by: Ben Ye <[email protected]>

* add compression scheme const to remote index cache

Signed-off-by: Ben Ye <[email protected]>

* address required comments

Signed-off-by: Ben Ye <[email protected]>

* fix compression scheme name

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: upgrading logs for failed uploads to error (#6427)

* FIX: upgrading log for failed upload to error

Signed-off-by: Victor Fernandes <[email protected]>

* docs: added changelog entry

Signed-off-by: Victor Fernandes <[email protected]>

---------

Signed-off-by: Victor Fernandes <[email protected]>

* fix postings test

Signed-off-by: Ben Ye <[email protected]>

* Add aiven as adopter... more soon!

Signed-off-by: Jonah Kowall <[email protected]>

* First draft of the Aiven adoption story

Signed-off-by: Jonah Kowall <[email protected]>

* Add aiven as adopter... more soon! (#6430)

Signed-off-by: Jonah Kowall <[email protected]>

* Report gRPC connnection errors to the caller (#6428)

By default `grpc.DialContext()` is non-blocking so any connection issue
will not be surfaced to the user. This change makes it blocking and
configures the gRPC dialer to report the underlying error if any
happens.

Signed-off-by: Simon Pasquier <[email protected]>

* chore: remove duplicated `gopkg.in/fsnotify.v1` dep (#6432)

* chore: remove duplicated `gopkg.in/fsnotify.v1` dep

`github.com/fsnotify/fsnotify` and `gopkg.in/fsnotify.v1` are the same
dependency. We can keep `github.com/fsnotify/fsnotify` and remove
`gopkg.in/fsnotify.v1`.

Signed-off-by: Eng Zer Jun <[email protected]>

* docs: add changelog

Signed-off-by: Eng Zer Jun <[email protected]>

---------

Signed-off-by: Eng Zer Jun <[email protected]>

* Expose estimated chunk and series size as configurable options (#6426)

* expose estimated chunk and series size as configurable options

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: make tsdb stats limit configurable (#6437)

* Receive: make tsdb stats limit configurable

Signed-off-by: Michael Hoffmann <[email protected]>

* Receive: make tsdb stats limit configurable

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Michael Hoffmann <[email protected]>

* *: wire new Engine/Explain fields in query-frontend (#6433)

- Pass Engine/Explain fields in query-frontend codecs
- Add Engine field to QFE cache key
- Add e2e tests for all cases

Signed-off-by: Giedrius Statkevičius <[email protected]>

* index cache: Cache expanded postings (#6420)

* cache expanded postings in index cache

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* fix

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* rebase main and added compression name to key

Signed-off-by: Ben Ye <[email protected]>

* update key

Signed-off-by: Ben Ye <[email protected]>

* add e2e test for memcached

Signed-off-by: Ben Ye <[email protected]>

* fix cache config

Signed-off-by: Ben Ye <[email protected]>

* address review comments

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* add approximate series size to index stats (#6425)

Signed-off-by: Ben Ye <[email protected]>

* index stats: fix chunk size calculation (#6424)

Signed-off-by: Ben Ye <[email protected]>

* Remove some unused Cortex vendored code and metrics (#6440)

* Avoid direct cortex vendor dependency in promclient (#6443)

* use own explanation struct

Signed-off-by: Ben Ye <[email protected]>

* omit empty

Signed-off-by: Ben Ye <[email protected]>

* fix e2e test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* query.md: Added grpc_{client,server}_handled_total to metrics list. (#6351)

Fixes: #6280

Signed-off-by: Jonathan Davies <[email protected]>

* Updates busybox SHA (#6448)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* store: read postings directly into delta encoded format (#6442)

Instead of allocating bytes for raw postings, let's read them directly
into diff varint format to save memory.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* compact: Add Index Stats to block metadata (#6441)

* compactor set index stats on block

Signed-off-by: Ben Ye <[email protected]>

* comment

Signed-off-by: Ben Ye <[email protected]>

* change field

Signed-off-by: Ben Ye <[email protected]>

* update downsample

Signed-off-by: Ben Ye <[email protected]>

* add index stats into compaction

Signed-off-by: Ben Ye <[email protected]>

* fix tests

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* estimate block chunk and series size from metadata (#6449)

Signed-off-by: Ben Ye <[email protected]>

* Adding graphic for blog showing architecture

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing mermaid graph

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing mermaid graph again

Signed-off-by: Jonah Kowall <[email protected]>

* Remove image and fix mermaid for other flowchart

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing prod flowchart

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing prod flowchart title

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing md table

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing md table again

Signed-off-by: Jonah Kowall <[email protected]>

* Adding clarification on cost breakdowns

Signed-off-by: Jonah Kowall <[email protected]>

* Adding clarification on cost breakdowns

Signed-off-by: Jonah Kowall <[email protected]>

* Store: fix crash on empty regex matcher

Signed-off-by: Michael Hoffmann <[email protected]>

* Some corrections on text and links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing links

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing diagams

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing currencies

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing diagams

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing images

Signed-off-by: Jonah Kowall <[email protected]>

* Website: Fix blog images width (#6450)

* Set blog post images width to 100%

Blog Post images width isn't set and hence the images doesn't get
fit to the page. Setting width to 100% make sure images fit to
the web page and screen size.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Remove width constraint from blog images

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* Cache calculated mint and maxt for each remote engine (#6458)

The distributed optimizer in the Thanos engine calls MinT() and LabelSets multiple times
on each remote engine. These calculations can get expensive when an engine
covers a large amount of TSDBs.

This commit introduces caching of the calculated values for a remote
engine's mint, maxt and label sets.

Signed-off-by: Filip Petkovski <[email protected]>

* cache empty expanded postings (#6464)

Signed-off-by: Ben Ye <[email protected]>

* mixin/receive: add limits alerting (#6466)

* add some thanos receive limits alerts

Signed-off-by: Thibault Mange <[email protected]>

* update changelog

Signed-off-by: Thibault Mange <[email protected]>

* fix and generate examples

Signed-off-by: Thibault Mange <[email protected]>

* quick fix

Signed-off-by: Thibault Mange <[email protected]>

* quick fix

Signed-off-by: Thibault Mange <[email protected]>

* fix test

Signed-off-by: Thibault Mange <[email protected]>

* fix invalid changelog

Signed-off-by: Thibault Mange <[email protected]>

---------

Signed-off-by: Thibault Mange <[email protected]>

* Update docs/blog/2023-06-08-thanos-at-aiven.md

Co-authored-by: Bartlomiej Plotka <[email protected]>
Signed-off-by: Jonah Kowall <[email protected]>

* Add retention for M3

Signed-off-by: Jonah Kowall <[email protected]>

* Add image versus mermaid diagram. Couldn't comment it out unfortunately

Signed-off-by: Jonah Kowall <[email protected]>

* Adding text around link to fix linter

Signed-off-by: Jonah Kowall <[email protected]>

* make docs

Signed-off-by: Jonah Kowall <[email protected]>

* add alert for tenant reaching head series limit (#6467)

Signed-off-by: Thibault Mange <[email protected]>

* go.mod: bump rest of otel libs (#6447)

* go.mod: bump rest of otel libs

Bump these two OTEL libs to be like the rest of the OTEL libs. We had a
strange issue where `service.name` was not set even though it was in
environment variables. Bumping these libs fixes the problem.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* otlp: only set service.name if provided

Signed-off-by: Giedrius Statkevičius <[email protected]>

* e2e: add test case

Signed-off-by: Giedrius Statkevičius <[email protected]>

---------

Signed-off-by: Giedrius Statkevičius <[email protected]>

* store: disable pooling for postings benchmarks (#6473)

Pooling hides the real allocations in postings benchmarks because the
allocation only happens once really. In reality this is different when
multiple readers are created at once. Disable pooling in benchmarks to
understand what is happening.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Fixing date and author for Aiven blog (#6476)

* Fixing authors

Signed-off-by: Jonah Kowall <[email protected]>

* make docs and fixing date

Signed-off-by: Jonah Kowall <[email protected]>

* Fixing authors

Signed-off-by: Jonah Kowall <[email protected]>

---------

Signed-off-by: Jonah Kowall <[email protected]>

* Check context when expanding postings 2nd attempt (#6471)

* check context when expanding postings

Signed-off-by: Ben Ye <[email protected]>

* import

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* [FEAT] Add thanos ruler blog post (#6477)

Signed-off-by: Hélia Barroso <[email protected]>

* blog: Small fixes to Aiven article (#6481)

* Correct some links and typos in 2023-06-08-thanos-at-aiven.md

The linkified URLs in the article were including the closing bracket, breaking the links. Make them proper Markdown links.
Also fixed a few other typos I spotted.

Signed-off-by: Hugh Cole-Baker <[email protected]>

* Update 2023-06-08-thanos-at-aiven.md

Clarify a couple of things in the final paragraph.

Signed-off-by: Hugh Cole-Baker <[email protected]>

---------

Signed-off-by: Hugh Cole-Baker <[email protected]>

* Rename series and postings fetch duration metrics (#6479)

* fix wrong metric names for series and postings fetch duration

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* note breaking change

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Update to prometheus/common v0.44.0 (#6483)

Signed-off-by: Dan Bason <[email protected]>

* go.mod: update rueidis client (#6485)

The latest improvements have great perf improvements. Let's update it.
Thank you to [rueian](https://github.com/rueian) and all of the
contributors to that awesome Redis client!

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Introduce tenancy package (#6482)

This commit introduces a tenancy package in preparation for introduction
of tenancy in the query path. Tenancy related code which can be common
between components are moved out of the receive component into the
tenancy package.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Ignore nginx.com links in mdox (#6489)

Signed-off-by: Saswata Mukherjee <[email protected]>

* blog: Update Aiven blog post (#6487)

Wording changes and better formatting for the tables.

Signed-off-by: Simon Brüggen <[email protected]>

* store: optimized snappy streamed reading (#6475)

Optimize snappy streamed reading by traversing through the byte slice in
advance to determine how big of a buffer we will need. I have opted to
rewrite snappy streamed format decoding because it is a straightforward
format. Complex parts were deferred to klauspost/compress.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Remove Exists call in meta fetcher (#6474)

* Remove Exists call in meta fetcher

The meta fetcher lists the bucket by iterating through
top level paths from the entire keyspace, and then for each key
calls Exists on the meta.json file. This leads to an N+1 amplification
against object storage, manifesting as a very high increase in costs
and occasional throttling by cloud providers.

This commit changes the iteration logic to recursively list all files instead,
which can be done with far fewer API calls to object storage. Meta files
are then identified from the keys returned by the list operation instead
of making one API request from each file.

Signed-off-by: Filip Petkovski <[email protected]>

* Revert e2e test change

Signed-off-by: Filip Petkovski <[email protected]>

---------

Signed-off-by: Filip Petkovski <[email protected]>

* e2e/store: use now instead of time.Now() each time (#6493)

Consistently use the same timestamp instead of the current time each
time during a test.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* [FIX] Documentation issue (#6494)

Signed-off-by: Hélia Barroso <[email protected]>

* Updates busybox SHA (#6497)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* chore: pkg imported more than once (#6499)

* chore: pkg imported more than once

Signed-off-by: guoguangwu <[email protected]>

* fix: remove pkg alias

Signed-off-by: guoguangwu <[email protected]>

---------

Signed-off-by: guoguangwu <[email protected]>

* *: Remove unnecessary configuration reload from `ContentPathReloader` and improve its tests (#6496)

* Fix and improve PathContentReloader tests

Signed-off-by: Douglas Camata <[email protected]>

* Run tests in parallel

Signed-off-by: Douglas Camata <[email protected]>

* Add changelog entry

Signed-off-by: Douglas Camata <[email protected]>

* Fix table tests

Signed-off-by: Douglas Camata <[email protected]>

* Fix typo

Co-authored-by: Filip Petkovski <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>
Co-authored-by: Filip Petkovski <[email protected]>

* add context check when decoding cached postings (#6506)

Signed-off-by: Ben Ye <[email protected]>

* *: Change the engine behind `ContentPathReloader` to be completely independent of any filesystem concept. (#6503)

* Add fallback config reload for symlinks

Signed-off-by: Douglas Camata <[email protected]>

* Improve pooling config reload

Signed-off-by: Douglas Camata <[email protected]>

* Make tests more reliable

Signed-off-by: Douglas Camata <[email protected]>

* Improve tests again

Assert on runutil.Repeat output

Signed-off-by: Douglas Camata <[email protected]>

* Pass the debounce/reload time to each test

Signed-off-by: Douglas Camata <[email protected]>

* Add comments and ensure interfaces are implemented

Signed-off-by: Douglas Camata <[email protected]>

* Make the limit configuration reload time customizable

Signed-off-by: Douglas Camata <[email protected]>

* goimports file

Signed-off-by: Douglas Camata <[email protected]>

* Fix lint warning

Signed-off-by: Douglas Camata <[email protected]>

* Improve log for polling engine

Signed-off-by: Douglas Camata <[email protected]>

* Fix tests

Signed-off-by: Douglas Camata <[email protected]>

* Make linter happy

Signed-off-by: Douglas Camata <[email protected]>

* Extract symlink identification to a separate function

Signed-off-by: Douglas Camata <[email protected]>

* Update changelog

Signed-off-by: Douglas Camata <[email protected]>

* Fix links to go-grpc-middleware after v2 merge into main

Signed-off-by: Douglas Camata <[email protected]>

* Add period to make linter happy.

Signed-off-by: Douglas Camata <[email protected]>

* Update changelog entry

Signed-off-by: Douglas Camata <[email protected]>

* Replace the fsnotify based engine from `PathContentReloader` with the polling one

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Remove check for empty filePath

Signed-off-by: Douglas Camata <[email protected]>

* Unexpose pollingEngine.Start

Signed-off-by: Douglas Camata <[email protected]>

* Fix pollingEngine doc-comment

Signed-off-by: Douglas Camata <[email protected]>

* Log file path when config is reloaded

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>

* receive: add float histogram support (#6323)

* Added receive float histogram support

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Fixed imports

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Added comments for fns copied from Prometheus

Signed-off-by: Sebastian Rabenhorst <[email protected]>

Improved comment

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Removed unnecessary if

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Fixed native histogram proto conversion in remote engine

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Removed unused histogram conversion from remote engine

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Fix and renaming in native_histograms_test.go

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Trigger Build

Signed-off-by: Sebastian Rabenhorst <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* go.mod: bump e2e framework version (#6516)

Bump e2e framework version and add a note about E2E_DOCKER_CPUS.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Add changelog for #6474 (#6518)

Signed-off-by: Filip Petkovski <[email protected]>

* cortex/redisclient: use rueidis client (#6520)

* cortex/redisclient: use rueidis client

Use the same rueidis client in query-frontend. Solves
https://github.com/thanos-io/thanos/issues/6094.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* cortex/cache: gofumpt + fix errors.Errorf

Signed-off-by: Giedrius Statkevičius <[email protected]>

* cacheutil/docs: clean up more old stuff

Signed-off-by: Giedrius Statkevičius <[email protected]>

---------

Signed-off-by: Giedrius Statkevičius <[email protected]>

* index header: Remove memWriter from fileWriter (#6509)

* index header: remove memWriter from fileWriter

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* refactor

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

* update comment

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Wrap object store Prometheus registry (#6152)

* Wrap object store Prometheus registery

In preparation for the work being done at https://github.com/thanos-io/objstore/pull/26.

Signed-off-by: Douglas Camata <[email protected]>

* Update objstore to the latest version

This version removes the `thanos_` prefix from metrics, which is the
reason for wrapping the objstore's metrics registry in the first place.

Signed-off-by: Douglas Camata <[email protected]>

* Fix modules

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Wrap metrics registerer for objstore bucket

Signed-off-by: Douglas Camata <[email protected]>

* Remove prefix from Thanos Store metrics

Signed-off-by: Douglas Camata <[email protected]>

* Fix goimports

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Put back upgraded objstore dep

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Move to more recent ref of thanos/objstore

Signed-off-by: Douglas Camata <[email protected]>

* Ignore OBS in objstore tests

Signed-off-by: Douglas Camata <[email protected]>

* Fix linting error on main test after objstore upgrade

Signed-off-by: Douglas Camata <[email protected]>

* Skip OCS objstore test in circle ci

Signed-off-by: Douglas Camata <[email protected]>

* Fix echo in makefile

Signed-off-by: Douglas Camata <[email protected]>

* Fix typo

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>

* e2e/store: try to fix Series() limit test again (#6522)

I finally managed to reproduce this failure locally with
http…
fpetkovski added a commit to fpetkovski/thanos that referenced this issue Jan 26, 2024
…hanos-io#199)

* Replace summary in extprom metrics with histogram (thanos-io#6327)

* Replaced summary in extprom metrics with histogram

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Added changelog

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Removed unused parameters from NewInstrumentationMiddleware

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Reverted NewInstrumentationMiddleware

Signed-off-by: Sebastian Rabenhorst <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>

* Avoid expensive log.Valuer evaluation for disallowed levels (thanos-io#6322)

Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>

* Fix inconsistent error for series limits in Store API (thanos-io#6330)

* store: fix inconsistent error for series limits

Signed-off-by: Thibault Mange <[email protected]>

* update changelog

Signed-off-by: Thibault Mange <[email protected]>

* Update pkg/store/bucket.go

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Thibault Mange <[email protected]>

* Update pkg/store/bucket.go

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Thibault Mange <[email protected]>

* rename labelValues serires liimiter test function

Signed-off-by: Thibault Mange <[email protected]>

---------

Signed-off-by: Thibault Mange <[email protected]>
Co-authored-by: Saswata Mukherjee <[email protected]>

* *: remove unmaintained gzip library (thanos-io#6332)

Switch from nytimes gzip library to the klaustpost's gzip code. The old
gzip HTTP handler shows up a lot in allocs so that's how I ended up
doing this change.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* Traces sampler env var (thanos-io#6306)

* Issue#5947 OTEL_TRACES_SAMPLER env var

Signed-off-by: shayyxi <[email protected]>

* Test correction

Signed-off-by: shayyxi <[email protected]>

* doc failure correction. parse float argument correction.

Signed-off-by: shayyxi <[email protected]>

* added the changelog.

Signed-off-by: shayyxi <[email protected]>

* ran make docs to fix the build failure.

Signed-off-by: shayyxi <[email protected]>

* corrected the incorrect change in tools.md

Signed-off-by: shayyxi <[email protected]>

* fixed review comments.

Signed-off-by: shayyxi <[email protected]>

---------

Signed-off-by: shayyxi <[email protected]>
Signed-off-by: Shazi <[email protected]>
Co-authored-by: shayyxi <[email protected]>

* query: use storepb.SeriesServer (thanos-io#6334)

Use storepb.SeriesServer instead of the concrete struct. This allows
implementing functionality on top of the proxy.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* cacheutil: upgrade `rueidis` to v1.0.2 to improve error handling while shrinking a redis cluster. redis/rueidis#209 (thanos-io#6342)

* use github.com/onsi/gomega/gleak to detect goroutine leak with timeout

Signed-off-by: Rueian <[email protected]>

* fix: spelling errors DoInSpanWtihErr to DoInSpanWithErr (thanos-io#6345)

Signed-off-by: aimuz <[email protected]>

* Return grpc code resource exhausted for byte limit error (thanos-io#6325)

* return grpc code resource exhausted for byte limit error

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* update partial response strategy

Signed-off-by: Ben Ye <[email protected]>

* fix limit

Signed-off-by: Ben Ye <[email protected]>

* try to fix tests

Signed-off-by: Ben Ye <[email protected]>

* fix test error message

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Expose info for each TSDB

This commit exposes the label set alongside the min and max time
for each TSDB covered by a Store.

This information is used to scope the min time for a remote query
so that we do not produce partial aggregates in distriuted mode.

Signed-off-by: Filip Petkovski <[email protected]>

* Add test case for proxy store

Signed-off-by: Filip Petkovski <[email protected]>

* Bump promql-engine to fix thanos-io/promql-engine#239 (thanos-io#6349)

Signed-off-by: Alban HURTAUD <[email protected]>

* Updates busybox SHA (thanos-io#6365)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Query: Add +Inf bucket to query duration metrics  (thanos-io#6358)

* Query: Add +Inf bucket to query duration metrics

For the query duration metrics
(`thanos_store_api_query_duration_seconds`), we record query respond
latency, based on the size of the query (samples/series), and save to a
histogram.

However, when a query is made which exceeds the biggest sample/serie
size, we would prior to this commit, put the request into the largest
bucket.

With this commit, we instead create an `+Inf` bucket, and put requests
which are larger than the biggest defined bucket into that. This gives
more accurate results, and also allow one to see if the bucket sizes are
incorrectly sized.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* Tests: Mutex around non-thread safe random source

When creating test blocks, we use a non-thread safe random source, in
multiple goroutines. Due to this, tests would sometime panic.

This commits puts a mutex around calls using the same source, in order
to avoid this.

This should hopefully improve reliability of e2e tests.

Signed-off-by: Jacob Baungard Hansen <[email protected]>

---------

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* e2e(query): Reproduce dedup issue from thanos-io#6257

Signed-off-by: Douglas Camata <[email protected]>

* Add dedup e2e test for Receive

With internal and external labels support.

Signed-off-by: Douglas Camata <[email protected]>

* Simplify generated blocks for query test

Signed-off-by: Douglas Camata <[email protected]>

* Improve query dedup test

Signed-off-by: Douglas Camata <[email protected]>

* Write a query test for dedup with sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Refactor query dedup test with sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Fix Receive query test

Now it properly ensures the double dedup works (on internal and external labels).

Signed-off-by: Douglas Camata <[email protected]>

* Fix receive drawing

Signed-off-by: Douglas Camata <[email protected]>

* Add one extra test caes for query dedup from store

Signed-off-by: Douglas Camata <[email protected]>

* Complement test for Receive query with dedup

Signed-off-by: Douglas Camata <[email protected]>

* Complement test for Sidecar query dedup

Signed-off-by: Douglas Camata <[email protected]>

* Expected failure of block label query dedup tests

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Check context when expanding postings (thanos-io#6363)

* check context when expanding postings

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* ui: only keep name in store_matches param (thanos-io#6371)

We are doing store matching on the `name` field hence only keep that
field in the URL because otherwise the URL could get quite lengthy with
external labelsets inside of it.

Besides unit tests, I have also tested locally:
- Enable store filtering;
- Select store(-s);
- Copy/paste URL into the new tab and see that the same stores are
  loaded like expected;
- See that URL only has names in them.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* docs: replace --store with --endpoint

Replace deprecated `--store` with `--endpoint` in docs.

Signed-off-by: Paul Gier <[email protected]>

* Optimizing "grafana generated" regex matchers (thanos-io#6376)

* Opmizing Group Regex

Signed-off-by: Alan Protasio <[email protected]>

* fixing native histogram tests

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Cache: various index cache client improvements (thanos-io#6374)

* Query Explanation (thanos-io#6346)

* Return Query Explaination in QueryAPI

A param `explain` is added to QueryAPI, if true then explanation
returned by the `Explain()` method of the query having structure
`ExplainOutputNode` is returned in response.
Query Explanation is added under new field in response that is
`thanosInfo`.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add explain checkbox in thanos UI

A explain checkbox is added to Thanos Query UI, that requests for
query explanation from thanos query api.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add ExpandableNode Component

ExpandableNode component renders Query Explanation in the thanos
UI. Requires a new package `react-accessible-treeview`.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Disable Explain checkbox on prometheus engine

Prometheus engine sends out error if toggle explain button. To
provide better experience, the explain checkbox get disbaled on
switching to prometheus engine and enable back on switching to
thanos engine.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add alert box with horizontal scrolling for Explanation

Signed-off-by: Pradyumna Krishna <[email protected]>

* Remove ExpandableNode and Add ListTree

Updates the design for query explanation box, removes
`ExpandableNode` and the dependency. Builts a new `ListTree` that
does the same using reactstrap and custom css.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor refactor in Query API response

`thanosInfo` is removed from Query reponse and used `explanation`
directly. `disableCheckbox` is also renamed to
`disableExplainCheckbox` in thanos UI.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update UI tests to passing

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor UI changes and test fix

UI improvements and Panel test fix other way around, resetting
the results on panel construction.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update promql-engine to use Explain method

Signed-off-by: Pradyumna Krishna <[email protected]>

* Build UI assets

Build UI assets, that runs new thanos UI with explain button.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Revert proxy url change from package.json

`proxy` was accidently changed and committed with package.json
when removed dependency. Hence, reverting it back.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Minor changes in UI

Fix requested changes in UI.
- Rename `state` and `setState` to `mapping` and `setMapping`.
- Rename `NodeTree` to `QueryTree`.
- Use unicode characters instead of `-` and `+`.
- Fix blue box on explain button.

Signed-off-by: Pradyumna Krishna <[email protected]>

* Update UI assets

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* Implementing Regex optimization on the `MatchNotRegexp` and `MatchNotEqual` matcher type (thanos-io#6379)

* Implementing Regex optimization on the MatchNotRegexp matcher type

Signed-off-by: Alan Protasio <[email protected]>

* Opmizing MatchNotEqual

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Put back the correct makefile

Signed-off-by: Douglas Camata <[email protected]>

* Remove extra line that broke untouched test

Signed-off-by: Douglas Camata <[email protected]>

* Add back line break at end of makefile

Signed-off-by: Douglas Camata <[email protected]>

* Fix Receive single ingestor test

Signed-off-by: Douglas Camata <[email protected]>

* Reproduce dedup issue in Receive

Signed-off-by: Douglas Camata <[email protected]>

* Add even more test cases for dedup on store gw

Signed-off-by: Douglas Camata <[email protected]>

* Reproduce dedup bug in Sidecar

Signed-off-by: Douglas Camata <[email protected]>

* Reuse nginx image name

Signed-off-by: Douglas Camata <[email protected]>

* Let all users read the metrics file from static metrics server

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Rerun CI

Signed-off-by: Douglas Camata <[email protected]>

* Reformat asciiflow chart

Signed-off-by: Douglas Camata <[email protected]>

* Reuse static metrics server from e2e framework

Signed-off-by: Douglas Camata <[email protected]>

* add de-cix as adopter (thanos-io#6386)

Signed-off-by: Raul Garcia Sanchez <[email protected]>

* [chore] Updating Query Engine and Prometheus (thanos-io#6392)

* Updating Query Engine

Signed-off-by: Alan Protasio <[email protected]>

* fix prometheus breaking change

Signed-off-by: Alan Protasio <[email protected]>

* Update prometheus with prometheus/prometheus#12387

Signed-off-by: Alan Protasio <[email protected]>

---------

Signed-off-by: Alan Protasio <[email protected]>

* Receive: Allow specifying tenant-specific external labels in RouterIngestor (thanos-io#5777)

Signed-off-by: haanhvu <[email protected]>

* check context cancel when doing posting batches (thanos-io#6396)

Signed-off-by: Ben Ye <[email protected]>

* Expose store gateway query stats in series response hints (thanos-io#6352)

* expose query stats hints

Signed-off-by: Ben Ye <[email protected]>

* update

Signed-off-by: Ben Ye <[email protected]>

* add query stats hints in result

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* add merge method

Signed-off-by: Ben Ye <[email protected]>

* fix unit test

Signed-off-by: Ben Ye <[email protected]>

modify hints proto

Signed-off-by: Ben Ye <[email protected]>

fix unit test

Signed-off-by: Ben Ye <[email protected]>

update format

Signed-off-by: Ben Ye <[email protected]>

* update comments

Signed-off-by: Ben Ye <[email protected]>

* try again

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* receive: make az aware ketama hashring (thanos-io#6369)

* receive: make az aware ketama hashring

Signed-off-by: Alexander Rickardsson <[email protected]>

* receive: pass endpoints in hashring config as object

Signed-off-by: Michael Hoffmann <[email protected]>

* receive: add some tests for consistent hashing in presence of AZs

Signed-off-by: Michael Hoffmann <[email protected]>

* receive,docs: add migration note for az aware hashring

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Alexander Rickardsson <[email protected]>
Signed-off-by: Michael Hoffmann <[email protected]>
Co-authored-by: Michael Hoffmann <[email protected]>

* Proposal: query path tenancy  (thanos-io#6320)

* Add 1st version of query path tenancy proposal

Signed-off-by: Douglas Camata <[email protected]>

* Update proposal after initial feedback

Signed-off-by: Douglas Camata <[email protected]>

* Add cool picture

Signed-off-by: Douglas Camata <[email protected]>

* Include example in cross tenant query complications

Signed-off-by: Douglas Camata <[email protected]>

* Improve reasoning for why not using the QFE

Signed-off-by: Douglas Camata <[email protected]>

* Improve writing in "How" section

Signed-off-by: Douglas Camata <[email protected]>

* Fix owner profile link

Signed-off-by: Douglas Camata <[email protected]>

* Apply suggestions from code review

Co-authored-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Address few more PR review comments

Signed-off-by: Douglas Camata <[email protected]>

* Address feedback on flag name text

Signed-off-by: Douglas Camata <[email protected]>

* Update diagram

Signed-off-by: Douglas Camata <[email protected]>

* Improve non-goals text

Signed-off-by: Douglas Camata <[email protected]>

* Update diagram

Signed-off-by: Douglas Camata <[email protected]>

* Update docs/proposals-accepted/202304-query-path-tenancy.md

Co-authored-by: Filip Petkovski <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Clarify scenario for pitfalls of current solution

Signed-off-by: Douglas Camata <[email protected]>

* Clarify that Store doesn't care about tenant label

Signed-off-by: Douglas Camata <[email protected]>

* Add an action plan

Signed-off-by: Douglas Camata <[email protected]>

* Mention alternative idea of modifying Store API

Signed-off-by: Douglas Camata <[email protected]>

* Fix typo

Co-authored-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>

* Address lots of feedback on the proposal

Signed-off-by: Douglas Camata <[email protected]>

* Format query path tenancy proposal doc

Signed-off-by: Douglas Camata <[email protected]>

* Add a "Tenancy Model" subsection to "Goals"

Signed-off-by: Douglas Camata <[email protected]>

* Mention header semanthics in comparison with gRPC message field

Signed-off-by: Douglas Camata <[email protected]>

* Improve action plan structure and writing

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>
Co-authored-by: Saswata Mukherjee <[email protected]>
Co-authored-by: Filip Petkovski <[email protected]>
Co-authored-by: Giedrius Statkevičius <[email protected]>

* Fix double-counting bug in http_request_duration metric (thanos-io#6399)

* fix double-counting bug in http_request_duration metric

Signed-off-by: 4orty <[email protected]>

* Update Changelog

Signed-off-by: 4orty <[email protected]>

---------

Signed-off-by: 4orty <[email protected]>

* Updates busybox SHA (thanos-io#6403)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Fix series stats merge (thanos-io#6408)

* fix series stats merge

Signed-off-by: Ben Ye <[email protected]>

* update license header

Signed-off-by: Ben Ye <[email protected]>

* use reflect

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: allow unlimited head_series_limit tenants (thanos-io#6406)

With this commit we now allow to configure tenants with unlimited active
series limit by setting the limit to `0`. Prior to this commit setting a
per tenant limit to `0` would cause the tenant to be unable to write any
metrics at all.

This fixes: thanos-io#6393

Signed-off-by: Jacob Baungard Hansen <[email protected]>

* expose downloaded data size in query hints (thanos-io#6409)

Signed-off-by: Ben Ye <[email protected]>

* maintainers: add myself to triagers (thanos-io#6414)

Signed-off-by: Michael Hoffmann <[email protected]>

* Add `@douglascamata` to triagers (thanos-io#6418)

Signed-off-by: Douglas Camata <[email protected]>

* Add Blog (thanos-io#6411)

* Add LFX blog

Signed-off-by: Pradyumna Krishna <[email protected]>

* Add Headers to blog

Signed-off-by: Pradyumna Krishna <[email protected]>

* Lint blog

Signed-off-by: Pradyumna Krishna <[email protected]>

---------

Signed-off-by: Pradyumna Krishna <[email protected]>

* blog: Fix images for LFX post (thanos-io#6422)

* blog: Fix images for LFX post

Signed-off-by: Saswata Mukherjee <[email protected]>

* fix lint

Signed-off-by: Saswata Mukherjee <[email protected]>

---------

Signed-off-by: Saswata Mukherjee <[email protected]>

* Index Cache: Change cache key for postings (thanos-io#6405)

* extend postings cache key with codec

Signed-off-by: Ben Ye <[email protected]>

* add changelog

Signed-off-by: Ben Ye <[email protected]>

* update code back

Signed-off-by: Ben Ye <[email protected]>

* add colon

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* fix another test

Signed-off-by: Ben Ye <[email protected]>

* add compression scheme const to remote index cache

Signed-off-by: Ben Ye <[email protected]>

* address required comments

Signed-off-by: Ben Ye <[email protected]>

* fix compression scheme name

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: upgrading logs for failed uploads to error (thanos-io#6427)

* FIX: upgrading log for failed upload to error

Signed-off-by: Victor Fernandes <[email protected]>

* docs: added changelog entry

Signed-off-by: Victor Fernandes <[email protected]>

---------

Signed-off-by: Victor Fernandes <[email protected]>

* fix postings test

Signed-off-by: Ben Ye <[email protected]>

* Add aiven as adopter... more soon! (thanos-io#6430)

Signed-off-by: Jonah Kowall <[email protected]>

* Report gRPC connnection errors to the caller (thanos-io#6428)

By default `grpc.DialContext()` is non-blocking so any connection issue
will not be surfaced to the user. This change makes it blocking and
configures the gRPC dialer to report the underlying error if any
happens.

Signed-off-by: Simon Pasquier <[email protected]>

* chore: remove duplicated `gopkg.in/fsnotify.v1` dep (thanos-io#6432)

* chore: remove duplicated `gopkg.in/fsnotify.v1` dep

`github.com/fsnotify/fsnotify` and `gopkg.in/fsnotify.v1` are the same
dependency. We can keep `github.com/fsnotify/fsnotify` and remove
`gopkg.in/fsnotify.v1`.

Signed-off-by: Eng Zer Jun <[email protected]>

* docs: add changelog

Signed-off-by: Eng Zer Jun <[email protected]>

---------

Signed-off-by: Eng Zer Jun <[email protected]>

* Expose estimated chunk and series size as configurable options (thanos-io#6426)

* expose estimated chunk and series size as configurable options

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

* fix test

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* Receive: make tsdb stats limit configurable (thanos-io#6437)

* Receive: make tsdb stats limit configurable

Signed-off-by: Michael Hoffmann <[email protected]>

* Receive: make tsdb stats limit configurable

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Michael Hoffmann <[email protected]>

* *: wire new Engine/Explain fields in query-frontend (thanos-io#6433)

- Pass Engine/Explain fields in query-frontend codecs
- Add Engine field to QFE cache key
- Add e2e tests for all cases

Signed-off-by: Giedrius Statkevičius <[email protected]>

* index cache: Cache expanded postings (thanos-io#6420)

* cache expanded postings in index cache

Signed-off-by: Ben Ye <[email protected]>

* update changelog

Signed-off-by: Ben Ye <[email protected]>

* fix

Signed-off-by: Ben Ye <[email protected]>

* fix lint

Signed-off-by: Ben Ye <[email protected]>

* rebase main and added compression name to key

Signed-off-by: Ben Ye <[email protected]>

* update key

Signed-off-by: Ben Ye <[email protected]>

* add e2e test for memcached

Signed-off-by: Ben Ye <[email protected]>

* fix cache config

Signed-off-by: Ben Ye <[email protected]>

* address review comments

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>

* add approximate series size to index stats (thanos-io#6425)

Signed-off-by: Ben Ye <[email protected]>

* index stats: fix chunk size calculation (thanos-io#6424)

Signed-off-by: Ben Ye <[email protected]>

* Remove some unused Cortex vendored code and metrics (thanos-io#6440)

* Fixed DefaultPromConfig

* Fixed imports

* Back to diffVarintSnappyEncode

* Merge pull request thanos-io#180 from Shopify/optimize-timerange-calculation

Cache calculated mint and maxt for each remote engine

* Updated busybox

* fixing lint

* Fixing merge conflict

Signed-off-by: Pedro Tanaka <[email protected]>

* Fixing missing import

Signed-off-by: Pedro Tanaka <[email protected]>

* fix lint again

Signed-off-by: Pedro Tanaka <[email protected]>

* resolving conflict merges

Signed-off-by: Pedro Tanaka <[email protected]>

* Fixed import and fn order

* Fixed unit tests

* Updated promdoc.sum

* Back to custom promql engine

* Removed custom promql engine and moved to latest upstream

* Ran go mod tidy

* Fixed GetQueryAPIClients

* Store: fix crash on empty regex matcher

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Sebastian Rabenhorst <[email protected]>
Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
Signed-off-by: Thibault Mange <[email protected]>
Signed-off-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: shayyxi <[email protected]>
Signed-off-by: Shazi <[email protected]>
Signed-off-by: Rueian <[email protected]>
Signed-off-by: aimuz <[email protected]>
Signed-off-by: Ben Ye <[email protected]>
Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: Alban HURTAUD <[email protected]>
Signed-off-by: GitHub <[email protected]>
Signed-off-by: Jacob Baungard Hansen <[email protected]>
Signed-off-by: Douglas Camata <[email protected]>
Signed-off-by: Paul Gier <[email protected]>
Signed-off-by: Alan Protasio <[email protected]>
Signed-off-by: Pradyumna Krishna <[email protected]>
Signed-off-by: Raul Garcia Sanchez <[email protected]>
Signed-off-by: haanhvu <[email protected]>
Signed-off-by: Alexander Rickardsson <[email protected]>
Signed-off-by: Michael Hoffmann <[email protected]>
Signed-off-by: 4orty <[email protected]>
Signed-off-by: Michael Hoffmann <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Victor Fernandes <[email protected]>
Signed-off-by: Jonah Kowall <[email protected]>
Signed-off-by: Simon Pasquier <[email protected]>
Signed-off-by: Eng Zer Jun <[email protected]>
Signed-off-by: Pedro Tanaka <[email protected]>
Co-authored-by: Sebastian Rabenhorst <[email protected]>
Co-authored-by: Xiaochao Dong <[email protected]>
Co-authored-by: Thibault Mange <[email protected]>
Co-authored-by: Saswata Mukherjee <[email protected]>
Co-authored-by: Giedrius Statkevičius <[email protected]>
Co-authored-by: Shazi <[email protected]>
Co-authored-by: shayyxi <[email protected]>
Co-authored-by: Rueian <[email protected]>
Co-authored-by: aimuz <[email protected]>
Co-authored-by: Ben Ye <[email protected]>
Co-authored-by: Filip Petkovski <[email protected]>
Co-authored-by: Alban Hurtaud <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: fpetkovski <[email protected]>
Co-authored-by: Jacob Baungård Hansen <[email protected]>
Co-authored-by: Douglas Camata <[email protected]>
Co-authored-by: Paul Gier <[email protected]>
Co-authored-by: Alan Protasio <[email protected]>
Co-authored-by: Pradyumna Krishna <[email protected]>
Co-authored-by: Raúl Garcia Sanchez <[email protected]>
Co-authored-by: Ha Anh Vu <[email protected]>
Co-authored-by: Alexander Rickardsson <[email protected]>
Co-authored-by: Michael Hoffmann <[email protected]>
Co-authored-by: Giedrius Statkevičius <[email protected]>
Co-authored-by: Wonki Kim <[email protected]>
Co-authored-by: Michael Hoffmann <[email protected]>
Co-authored-by: Victor Hugo Brito Fernandes <[email protected]>
Co-authored-by: Jonah Kowall <[email protected]>
Co-authored-by: Simon Pasquier <[email protected]>
Co-authored-by: Eng Zer Jun <[email protected]>
Co-authored-by: Sebastian Rabenhorst <[email protected]>
fpetkovski pushed a commit to fpetkovski/thanos that referenced this issue Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment