Jaeger API: inverted tag filters (key!) for exact and regex matches#137
Open
emamihe wants to merge 1 commit into
Open
Jaeger API: inverted tag filters (key!) for exact and regex matches#137emamihe wants to merge 1 commit into
emamihe wants to merge 1 commit into
Conversation
2 tasks
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.
Summary
Implements inverted tag filtering for the Jaeger trace query API, matching how the Jaeger UI encodes negation:
key!=valueis sent as JSON{"key!": "value"}. Regex continues to use the existing~prefix on the value (e.g.{"key!": "~pattern"}for negated regex).Motivation
Requested in review and aligned with #120: users need to exclude spans/traces by tag (including regex), not only include them.
Changes
app/vtselect/traces/jaeger/jaeger.go: After unmarshallingtags, strip a trailing!from each key before mapping to storage field names (span_attr:…, resource/scope prefixes,spanAttributeMap). Mark negated filters by prefixing the internal attribute key with!.app/vtselect/traces/query/query.go: IngetTraceIDList, if the attribute key is negated (!prefix), append LogsQL!(field:=…)or!(field:re(…))instead of positive filters.app/vtselect/traces/query/query_test.go: Parse test to ensure the inverted LogsQL shape is accepted bylogstorage.apptest/tests/otlp_ingestion_test.go: Integration-style checks for inverted regex (non-matching pattern keeps the trace; matching pattern excludes it).docs/victoriatraces/changelog/CHANGELOG.md:tipchangelog entry for this feature.How to verify
go test ./app/vtselect/traces/query/ ./app/vtselect/traces/jaeger/victoria-tracesbinary:go test ./apptest/tests/ -run TestSingleOTLPIngestionJaegerQuerySummary by cubic
Adds inverted tag filters to the Jaeger trace query API so you can exclude spans/traces using
key!=valueandkey!=~regex, matching the Jaeger UI’s encoding{"key!": "value"}and{"key!": "~pattern"}.tagswith keys ending in!, map to storage fields, and carry negation internally.!(field:=...)and!(field:re(...)).Written for commit 8c83dd7. Summary will update on new commits.