Queriers: Fix external search config when using RBAC with Google Cloud Run#2722
Merged
joe-elliott merged 1 commit intografana:mainfrom Jul 28, 2023
Merged
Conversation
7f35adf to
c44ed2c
Compare
Signed-off-by: modulitos <hi@modulitos.com>
c44ed2c to
1cd0cfa
Compare
mapno
approved these changes
Jul 28, 2023
Contributor
mapno
left a comment
There was a problem hiding this comment.
LGTM.
cc/ @joe-elliott, bugfix to include in v2.2
joe-elliott
reviewed
Jul 28, 2023
| func (q *Querier) SearchBlock(ctx context.Context, req *tempopb.SearchBlockRequest) (*tempopb.SearchResponse, error) { | ||
| // if we have no external configuration always search in the querier | ||
| if len(q.cfg.Search.ExternalEndpoints) == 0 { | ||
| if q.cfg.Search.ExternalBackend == "" && len(q.cfg.Search.ExternalEndpoints) == 0 { |
Collaborator
There was a problem hiding this comment.
i think this can be a cleaner check in the future, but i'm fine with it for now.
Merged
3 tasks
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 28, 2023
Signed-off-by: modulitos <hi@modulitos.com> (cherry picked from commit 2cb5a7b)
joe-elliott
pushed a commit
that referenced
this pull request
Jul 28, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
I implemented a feature enabling RBAC on Google Cloud Run endpoints, which was merged last week: #2593
But there is a bug with the configuration, as described below. This PR fixes that bug.
Repro:
Run Tempo with the following config:
Open the Grafana Tempo explore panel, and search for traces.
We'll see traces in our results, but they should be coming from our external Cloud Run endpoint, not an internal block search.
Expected:
Block queries are sent to the external Cloud Run endpoint.
Actual:
An internal search is performed instead of an external search. This is because the
querier.search.external_endpointslist is unset, so it defaults to an empty list, and is caught by this conditional:tempo/modules/querier/querier.go
Lines 716 to 718 in 41dfbc4
We can work around it by defining a non-empty
querier.search.external_endpointslist:but clearly that's not desirable. This PR fixes the conditional and adds a unit test to cover this code path.
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]