-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support regex tags search for Elasticseach backend #2049
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ca65f26
Add regex tag filter for ES backend
annanay25 f94c220
[ES] Add support to check for presence of a tag
annanay25 d9afd37
Revert "[ES] Add support to check for presence of a tag"
annanay25 6f87b93
Add query builder and integration tests
annanay25 0955efa
Fix tests
annanay25 af7baa6
Add ES specific integration tests
annanay25 039e6c9
Improve tag search tests
annanay25 0d2fb5e
Nit, clean function params
annanay25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"bool":{ | ||
"should":[ | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"tag.bat@foo":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"process.tag.bat@foo":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"tags.value":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"process.tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"process.tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"process.tags.value":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"logs.fields", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"logs.fields.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"logs.fields.value":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"bool":{ | ||
"should":[ | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"tag.bat@foo":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"process.tag.bat@foo":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"tags.value":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"process.tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"process.tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"process.tags.value":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"logs.fields", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"logs.fields.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"logs.fields.value":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
33 changes: 33 additions & 0 deletions
33
plugin/storage/integration/fixtures/traces/tags_regex_trace.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"spans": [ | ||
{ | ||
"traceId": "AAAAAAAAAAAAAAAAAAAAEh==", | ||
"spanId": "AAAAAAAAAAU=", | ||
"operationName": "query23-operation", | ||
"references": [], | ||
"startTime": "2017-01-26T16:46:31.639875Z", | ||
"duration": "1000ns", | ||
"tags": [ | ||
{ | ||
"key": "sameplacetag1", | ||
"vType": "STRING", | ||
"vStr": "random*" | ||
} | ||
], | ||
"process": { | ||
"serviceName": "query23-service", | ||
"tags": [] | ||
}, | ||
"logs": [ | ||
{ | ||
"timestamp": "2017-01-26T16:46:31.639875Z", | ||
"fields": [] | ||
}, | ||
{ | ||
"timestamp": "2017-01-26T16:46:31.639875Z", | ||
"fields": [] | ||
} | ||
] | ||
} | ||
] | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@annanay25 do you mean this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the one above, "Tag regex + Operation name + max Duration"
It is supposed to match with just the
tags_regex_trace
but matches with bothtags_regex_trace
andtags_opname_trace
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one also looks wrong as it uses different service name https://github.com/jaegertracing/jaeger/blob/master/plugin/storage/integration/fixtures/traces/tags_opname_trace.json
Could you please debug it and or open an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you fix the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to mangle the traceID further -
0955efa#diff-1824d3ce6ce534210f34269d2370e966