-
Notifications
You must be signed in to change notification settings - Fork 29
feat(jaeger): add regex support for tag search in /api/traces #116
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,7 +59,7 @@ The `/select/jaeger/api/traces` HTTP endpoint provides the following params: | |
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The docs now show two different formats for the Prompt for AI agents |
||
| - `service`: the service name. | ||
| - `operation`: the span name (also known as the operation name in Jaeger). | ||
| - `tags`: the attributes (also known as tags) filter, example: `{"key":"value"}` | ||
| - `tags`: the attributes (also known as tags) filter, example: `{"key":"value"}`. Prefix a value with `~` to use regex matching, e.g. `{"key":"~value.*"}` | ||
| - `start`: the start timestamp in unix microseconds. | ||
| - `end`: the end timestamp in unix microseconds. | ||
| - `minDuration`: the minimum duration of the span, with units `ns`, `us`, `ms`, `s`, `m`, or `h`. | ||
|
|
@@ -216,3 +216,4 @@ Some valid filter examples: | |
| - Multiple span attribute filters: `error=unset otel.scope.name=redis-manual` | ||
| - Single resource attribute filter: `resource_attr:telemetry.sdk.language=go` | ||
| - Span attribute and resource attribute filters: `span.kind=client resource_attr:os.type=linux` | ||
| - Regex filter: prefix the value with `~` to match by regex, e.g. `{"order_id":"~abc.*"}` or `{"http.status_code":"~^2"}` for values starting with "2" | ||
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.
Hi. It seems the original implementation in Jaeger - Elasticsearch equals to
%q:~%qin LogsQL. It covers all the cases, which may make sense because I dont think user will check the LogsQL doc before using Jaeger API, and most likely they won't typea=~bin the tag filter input box.I would expect the user input to be
a=b.*ora=a.*b.*cand we should translate it into"a":~"a.*b.*c"directly.However, by doing so, since the
.means any character. It can lead to false matches. For example, the expression192.168.0.1may match1920168001.I'd like to ask for your opinion and also @manideep-qlub before further review.
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.
@jiekun - Thank you for the tag.
We'd prefer the
~prefix approach (as implemented by @emamihe ) for few reasons like "explicit intent", "it avoids false matches", "its predictable" as well