app/vtselect: honor extra_filters in Jaeger and Tempo APIs#184
app/vtselect: honor extra_filters in Jaeger and Tempo APIs#184immanuwell wants to merge 1 commit into
Conversation
bce1244 to
18d19f5
Compare
|
@JayiceZ fixed both suggestions in the latest push, PTAL |
| defer cancel() | ||
|
|
||
| cp.Query = q | ||
| cp.Query = cp.ApplyExtraFilters(q) |
There was a problem hiding this comment.
findTraceIDTimeSplitTimeRange will still apply extra filter
| q.AddPipeOffsetLimit(0, limit) | ||
|
|
||
| cp.Query = q | ||
| cp.Query = cp.ApplyExtraFilters(q) |
There was a problem hiding this comment.
internal request should not apply extra filters.
GetServiceGraphTimeRange and GetServiceDBGraphTimeRange are called by a background task, not users request.
| } | ||
|
|
||
| cp.Query = q | ||
| cp.Query = cp.ApplyExtraFilters(q) |
There was a problem hiding this comment.
I don't like executing this function everywhere. The extra filter should work just like hiddenFieldsFilters that live only in common path.
@immanuwell I'd like to rewrite it if you don't mind. And maybe you can talk an extra look after.
|
Generally the files under |
Describe Your Changes
Fixes #178
extra_filtersworked on native LogsQL endpoints, but Jaeger and Tempo paths just dropped it. That is kinda bad in auth scoped setups, becausevmauthcan inject?extra_filters=...in normal traffic.This patch parses
extra_filtersin shared trace request params and applies them to the trace query builders, including search, tags, traces and Tempo metrics. Also adds regression tests for parse, merge and bad input.Repro:
vmauth, or call a Jaeger or Tempo endpoint with?extra_filters={"env":"prod"}./select/tempo/api/searchor/select/tempo/api/v2/search/tags.Tests:
make test-fullmake apptestChecklist
Summary by cubic
Apply
extra_filterstoJaegerandTempotrace APIs so auth-scoped setups usingvmauthget the same filtering as LogsQL. This prevents overly broad results and keeps queries within tenant constraints.extra_filtersfrom requests and store intracecommon.CommonParams(ExtraFilters).CommonParams.ApplyExtraFiltersacross trace queries (search, tags, traces, service graph, metrics, exemplars).extra_filtersvalues.Written for commit bce1244. Summary will update on new commits.