query: fix exemplar proxy stripping external label matchers in multi-tier topologies#8752
Conversation
fc019dc to
01ed452
Compare
|
Added an ignore rule in |
e6f9265 to
8388bdf
Compare
GiedriusS
left a comment
There was a problem hiding this comment.
LGTM, let's see if anyone else has any comments.
|
@saswatamcode @fpetkovski can you please review this? |
… exemplar proxy In multi-tier Query topologies (Query A → Query B → Sidecars), the exemplar proxy was stripping external label matchers before forwarding to all downstream stores. This stripping is necessary for Sidecars (Prometheus cannot handle external labels), but breaks Query-to-Query forwarding because the intermediate Query node needs the matchers for its own store routing. Add a SupportsExternalLabels field to ExemplarStore that indicates whether a downstream store can handle external label matchers. When constructing exemplar stores from endpoints, set this to true for Query component types. In the proxy fanout loop, only strip external label matchers for stores that do not support them. Fixes thanos-io#8702 Signed-off-by: Kc Balusu <kcbalusu@gmail.com>
Signed-off-by: Kc Balusu <kcbalusu@meta.com>
Add ignore rules for Grafana promtail docs (removed after EOL in March 2026) and db.cs.cmu.edu (DNS/timeout issues from CI). Signed-off-by: Kc Balusu <kcbalusu@meta.com>
Update the sed range in docs/components/receive.md from '1068,1078p' to '1067,1078p' to match the current line numbers in handler.go after upstream changes shifted the writeQuorum function. Signed-off-by: Kc Balusu <kcbalusu@meta.com>
8388bdf to
7b851b7
Compare
Can you comment how am I related to this? I might, I just do not know how. |
my bad, I tagged you on a different PR in a different repo and it got copy pasted into this. Apologies |
|
@saswatamcode @GiedriusS can you please help me getting this reviewed? |
|
Thank you 🙇 |
Changes
In multi-tier Query topologies (Query A → Query B → Sidecars), the exemplar proxy unconditionally strips matchers that match external labels before forwarding to all downstream stores. This stripping is correct for Sidecars (Prometheus cannot handle external labels), but breaks Query → Query → Sidecar setups because the intermediate Query node needs those matchers for its own store routing.
For example, when Query A receives
{cluster="A", namespace="foo"}, it stripscluster="A"before forwarding to Query B. Query B then receives{namespace="foo"}and fans out to all sidecars, returning exemplars from every cluster instead of just cluster A.This was introduced by #4123 (fix for #4116).
What this PR does
SupportsExternalLabelsfield toExemplarStorethat indicates whether a downstream store can handle external label matchers.GetExemplarsStores(), setsSupportsExternalLabels: trueforcomponent.Queryendpoints, since Query nodes can handle external labels for their own routing.Verification
TestProxyExternalLabelsPreservedForQueryStores: verifies that a downstream Query node receives the full matchers including external labels, while a non-matching Sidecar is correctly excluded.TestProxyExternalLabelsStrippedForSidecarStores: verifies backward compatibility — Sidecars still receive queries with external label matchers stripped.SupportsExternalLabelsdefaults tofalse).Fixes #8702
Changes have a CHANGELOG entry: yes